How to Set title and delete dijit.form.select in tablecontainer - dojo

I'm creating a table container, to which i'm adding select widget,
var layout1 = new dojox.layout.TableContainer({
showLabels: true,
orientation: "horiz",
cols : 2,
spacing: 5,
style: "border: solid 1px LightBlue;",
customClass : "tableContainer"
});
layout.placeAt(divContentNode);
Below is my select widget:
var ran = new dijit.form.Select(
{
id :"srz102" ,
name : "ZEND100",
title : "VAPORTforVA",
maxHeight : '100',
style:"width: 150px",
required:true,
options:v4
}
);
layout1.addChild(ran);
But with this i didn't get title for select widget,so i added
layout1.layout();
which displayed the title for select widget
Now when i try to destroy select widget i'm not able to delete the title
dijit.byId("srz102").destroyRecursive();

I guess you trying to get hold of select node and destroying. That's why your title is not deleting properly. Instead you should try catching its parent and then try destroying the child
If you are using dojo 1.7 + (AMD), you can use:
require(["dojo/dom-construct"], function(domConstruct){
// Destroy a node byId:
domConstruct.destroy("id");
})
For recursive deletion you can use :
dojo.query("id").forEach(dojo.destroy);
However you need to traverse the parent dom-node and delete each of them.
Just FYI dojo.query is very useful to get hold of any node not limited to id, you can get hold through css class like below
dojo.query(".cssClass")
Further ref :http://dojotoolkit.org/reference-guide/1.7/dojo/destroy.html

Related

Dropzone.js - creating dropzones programmatically returns "dropzone is not a function"

I'm trying to create dropzones programmatically through a function but I receive a element.dropzone is not a function error and I'm not quite sure why. I'm using Vue.js with Element UI
HTML
<div class="toUpload">
<div class="el-upload el-upload--text">
JS
submitMessage (){
return api.createMessage( messageToSend, ( message ) => {
// some code
this.insertAttachments( "toUpload", message.id );
} )
},
insertAttachments ( element, messageId ) {
element.dropzone( {
url: '/messages/' + messageId + '/attachments',
paramName: 'attachment',
previewsContainer: false,
uploadedMultiple: true,
maxfiles: 10,
parallelUploads: 10
} )
The value of element is a String ("toUpload") at the point where you are calling element.dropzone(). To use the dropzone method like that, you need to call it on a jQuery element.
You probably meant something like this:
$('.' + element).dropzone( ...

Why does my node not show a lable attached to it on the the graph :

I have used:
create(iss_2237:mission{ agency_no:'178', date: '2013-12-14', mission_no:'2237' })
create(iss_3664:mission{ agency_no:'526', date: '2014-01-16', mission_no:'3664' })
create(iss_2356:mission{ agency_no:'167', date: '2014-02-12', mission_no:'2356' })
create(iss_1234:mission{ agency_no:'032', date: '2014-04-16', mission_no:'1234' })
all the nodes labeled mission appear blank on the graph; where as my nodes labeled agency have one of the properties appear inside them on the graph.
create(jaxa:agency{ title : 'JAXA', country : 'Japan'})
create(esa:agency{ title : 'ESA', country : 'EU'})
create(nasa:agency{ title : 'NAS', country : 'USA'})
create(roskosmos:agency{ title : 'Roskosmos', country : 'Russia'})
What am I doing wrong?
my graph db
I think this might be an issue with the styling in the Neo4j Browser.
This page shows how you can update the styles, including specifying which property is shown in the visualization, specifically:
You can reset the Neo4j Browser styles with this command:
:style reset

How to set Id attribute of TDs while adding row in DataTable using row.add(data).draw().node();

How do I set the "id" attribute of one TD when I add a new row using this API of Datatables? Consider I have only one TD.
Here is an example from the API that performs an operation on newly added rows.
var table = $('#example').DataTable();
table
.rows.add( [
new Pupil( 43 ),
new Pupil( 67 ),
new Pupil( 102 )
] )
.draw()
.nodes()
.to$()
.addClass( 'new' );
.addClass() is a jquery method that they use here to add class="new" to the newly added rows.
So, instead of adding a class to the row, you could find all <td> in that row using .find(), then use .each() to call a function on each <td> to modify its id attribute using .attr().
var table = $('#example').DataTable();
var count = 0;
table
.rows.add( [
new Pupil( 43 ),
new Pupil( 67 ),
new Pupil( 102 )
] )
.draw()
.nodes()
.to$()
.find('td')
.each(function() {
$(this).attr('id', 'td' + (count++) );
});
Notice the use of a count variable to ensure that each id assigned is unique.
instead of using the count in the solution above, you can use the index created by jQuery-
.find('td')
.each(function(**index**) {
$(this).attr('id', 'td' + **index** );
});
Adding to let's say one of the column in td (say only 4th):
var datatableTable = $('#datatableTable').DataTable();
var json = JSON.parse(data);
for (var row in json) {
var toAdd = {
id: json[row].id,
name: json[row].name
};
var i = datatablePojectListTable.row.add(toAdd).draw().nodes().to$().find('td:eq(4)').each(function() {$(this).attr('id', 'td-' + idVal );});
// Add ID to row
datatablePojectListTable.rows(i).nodes().to$().attr("id", idVal);
}

Ext.NET MultiCombo not firing event after de-selecting last item

Below is the razor markup, that i am using to get Ext.NET MultiCombo as shown in attached image
Html.X().MultiComboFor(x => x.CountryCodes).MultiSelect(true)
.Editable(false)
.QueryMode(DataLoadMode.Local)
.TriggerAction(TriggerAction.All)
.DisplayField("COUNTRY_DESC")
.ValueField("COUNTRY_CD")
.LabelWidth(80)
.FieldLabel(PR.Resources.IP.IP.Country)
.Listeners(ls => { ls.Select.Handler = "setCountryCodes();return false;"; ls.Change.Handler = "return false;"; })
.Store(Html.X().Store()
.ID("storeListCountryForPTOTR")
.AutoLoad(false)
.Model(Html.X().Model()
.IDProperty("COUNTRY_CD")
.Fields(
new ModelField("COUNTRY_CD", ModelFieldType.String) { Mapping = "COUNTRY_CD" },
new ModelField("COUNTRY_DESC", ModelFieldType.String) { Mapping = "COUNTRY_DESC" }
)
)
.Proxy(Html.X().AjaxProxy()
.Url(Url.Action("GetPriceTrendCountryForCountryDropdown", "InternalPricing")).ActionMethods(methods =>
methods.Read = HttpMethod.POST
).Reader(Html.X().JsonReader().Root("data"))
)
)
As shown in markup i am handling Select event on checkbox check/uncheck.
but this event is not getting fired when i Un-Check remaining item from list.
What could be the reason that MultiCombo is not firing the event for last item uncheck?
The Select event is meant to fire on selecting an item only, not on deselecting.
Probably, MultiCombo's Change event is what you need.

Update records in extjs4 grid

I am using Extjs4 , I got 1 grid with checkboxes i need to update records selected by user.
I am getting all records selected by user
but problem is its not updating...Code looks as follows
{
xtype: 'button',
text: 'Save/Update',
iconCls : 'icon-save',
handler:function(){
//saveAndUpdate();
var s=grid.getSelectionModel().getSelection();
alert(s.length);
if(s.length==0){
alert(" No Records Selecteds");
}else{
for(var i=0;i<s.length;i++){
var menuKey=s[i].get('menuKey');
var addYN=s[i].get('addYN')==true?'Y':'N';
var editYN=s[i].get('editYN')==true?'Y':'N';
var viewYN=s[i].get('viewYN')==true?'Y':'N';
var deleteYN=s[i].get('deleteYN')==true?'Y':'N';
var exportYN=s[i].get('exportYN')==true?'Y':'N';
alert(menuKey+addYN+editYN+viewYN+deleteYN+exportYN);
var record = Ext.create('RoleMenuLinks');
record.set({
roleKey:roleKey.value,
menuKey:menuKey,
addYN:addYN,
editYN:editYN,
viewYN:viewYN,
deleteYN:deleteYN,
exportYN:exportYN
});
alert("All Record Set ");
tempStore.sync();
}
}
its not calling java controller .... ?
You are creating a record and not putting it anywhere in this code, you need to do something with it:
var record = Ext.create('RoleMenuLinks');
record.set({
roleKey:roleKey.value,
menuKey:menuKey,
addYN:addYN,
editYN:editYN,
viewYN:viewYN,
deleteYN:deleteYN,
exportYN:exportYN
});
// do something with the record here
Or are you supposed to be retrieving a record and updating it? Because this code is not doing that.