Opened 5 years ago

Closed 5 years ago

#18530 closed defect (invalid)

update dojo FilteringSelect in dojo datagrid when onchange of another FilteringSelect

Reported by: amlesh Owned by:
Priority: undecided Milestone: tbd
Component: General Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:

Description

i am inserting datagrid row multiple times and in every row i have three FilteringSelect? frist is country second is state third is city onChange of country i got state list and want to insert in state FilteringSelect?

function setDocketGridDataCallBack(response) {

var countryList = response.countryList; var stateList = response.defaultStatesList; var stateListJsonData = []; var countryListJsonData =[]; var cityListJsonData = [];

var item = {}; item.id = "0"; item.name = "--Select--"; item.selected = true; stateListJsonData.push(item); if(stateList){

for(var i=0; i < stateList.length; i++ ) {

item = {}; item.id = stateList[i].code; item.name = stateList[i].state; stateListJsonData.push(item);

};

};

var stateListData = {

identifier: 'id', label:'name', items: stateListJsonData

};

var stateListStore = new dojo.store.Memory({

data: stateListData

});

var item = {}; item.id = "0"; item.name = "--Select--"; item.selected = true; countryListJsonData.push(item); if(countryList){

for(var i=0; i < countryList.length; i++ ) {

item = {}; item.id = countryList[i].code; item.name = countryList[i].country;

countryListJsonData.push(item);

};

};

var countryListData = {

identifier: 'id', label:'name', items: countryListJsonData

};

var countryListStore = new dojo.store.Memory({

data: countryListData

});

var item = {}; item.id = "0"; item.name = "--Select--"; item.selected = true; cityListJsonData.push(item);

var cityListData = {

identifier: 'id', label:'name', items: cityListJsonData

};

var cityListStore = new dojo.store.Memory({

data: cityListData

});

docketGridData = {

identifier : 'id', label : 'id', items : []

};

require([ "dojo/_base/declare", "dojo/_base/lang", "dojo

Change History (2)

comment:1 Changed 5 years ago by amlesh

function setDocketGridDataCallBack(response) {

var countryList = response.countryList; var stateList = response.defaultStatesList; var stateListJsonData = []; var countryListJsonData =[]; var cityListJsonData = [];

var item = {}; item.id = "0"; item.name = "--Select--"; item.selected = true; stateListJsonData.push(item); if(stateList){

for(var i=0; i < stateList.length; i++ ) {

item = {}; item.id = stateList[i].code; item.name = stateList[i].state; stateListJsonData.push(item);

};

};

var stateListData = {

identifier: 'id', label:'name', items: stateListJsonData

};

var stateListStore = new dojo.store.Memory({

data: stateListData

});

var item = {}; item.id = "0"; item.name = "--Select--"; item.selected = true; countryListJsonData.push(item); if(countryList){

for(var i=0; i < countryList.length; i++ ) {

item = {}; item.id = countryList[i].code; item.name = countryList[i].country;

countryListJsonData.push(item);

};

};

var countryListData = {

identifier: 'id', label:'name', items: countryListJsonData

};

var countryListStore = new dojo.store.Memory({

data: countryListData

});

var item = {}; item.id = "0"; item.name = "--Select--"; item.selected = true; cityListJsonData.push(item);

var cityListData = {

identifier: 'id', label:'name', items: cityListJsonData

};

var cityListStore = new dojo.store.Memory({

data: cityListData

});

docketGridData = {

identifier : 'id', label : 'id', items : []

};

require([ "dojo/_base/declare", "dojo/_base/lang", "dojo/store/Memory",

"dojo/store/Observable", "dgrid/OnDemandGrid", "dijit/form/FilteringSelect", "dgrid/Keyboard", "dgrid/editor", "dgrid/Selection", "dojo/_base/json", "put-selector/put", "dijit/form/DateTextBox", "dijit/form/NumberTextBox", "dijit/form/TextBox","dojox/form/CheckedMultiSelect","dijit/form/SimpleTextarea", "dijit/form/ValidationTextBox", "dojo/domReady!" ],

function(declare, lang, Memory, Observable, Grid, FilteringSelect?, Keyboard,

editor, Selection, dojo, put, DateTextBox?, NumberTextBox?, CheckedMultiSelect?,ValidationTextBox?, SimpleTextarea?, TextBox?) {

store = new Observable(new Memory({

identifier : "id", data : docketGridData

}));

gridColumns = {

docketNumber : editor({label : 'Docket Number',editorArgs : {value : 0}}, TextBox?), noOfPackage : editor({label : 'Package #',editorArgs : {value : 0}}, NumberTextBox?), consigneeName : editor({label : 'Consignee Name',editorArgs : {value : 0}}, TextBox?), consogneeAddess : editor({label : 'Address',editorArgs : {value : 0}}, SimpleTextarea?), country : editor({label : 'Country',editorArgs : {store : countryListStore, onChange: changeCountry ,style : 'width:120px;', value : '0', required:true}}, FilteringSelect?), state : editor({label : 'State',editorArgs : {store : stateListStore, onChange: changeState,

style : 'width:120px;', value : '0'}}, FilteringSelect?),

city: editor({label : 'City',editorArgs : {store : cityListStore,style : 'width:120px;', value : '0'}}, FilteringSelect?), mobile : editor({label : 'Mobile',editorArgs : {value : 0}}, NumberTextBox?), email : editor({label : 'Email',editorArgs : {value : 0}}, TextBox?), zipCode: editor({label : 'ZipCode?',editorArgs : {value : 0}}, NumberTextBox?)

}; var CustomGrid? = declare([Grid, Keyboard, Selection ]); grid = new CustomGrid?({

columns : gridColumns,

store : store,

selectionMode : "single", cellNavigation : false

}, "operation_docket_grid"); grid.on("dgrid-select", function(event) { });

});

};

comment:2 Changed 5 years ago by bill

Resolution: invalid
Status: newclosed

Please post questions to the dojo-interest mailing list. Although to be honest, I'm not even sure what your question is.

Note: See TracTickets for help on using tickets.