dojo 1.8 - This time though server, unable to initialise and update ComboBox every time there ia a change in select -
i able able make work after have got help, though not able combobox display selected option.
this time wanted improvise jsfiddle connecting server, list. wondering why did not work though made based on previous jsfiddle.
when run firebug , firephp enabled. can see managed list not able initate combobox. firebug or firephp did not produce errors. please see jsfiddle.
meter_select.on('change', function() { console.debug('selected card = '+ meter_select.value); request.post('listofcards.php',{ //'call listmfg_codes()' data:{cardx : meter_select.value}, handleas:"json" }).then( function(response) { var memostore2 = new memory({data:response});//ok var card_select = registry.byid('node_cardselect');//ok //console.debug('response ='+ memostore2); console.debug('card select(1a) ='+card_select);//ok if(card_select) { card_select.store = memostore2; console.debug('card select(1c) ='+card_select); }//if else { card_select = new combobox({ store : memostore2, searchattr : "mfg_code" //style:{width:'200px'}, },"node_cardselect"); console.debug('card select(1b) ='+card_select); }//else //card_select.startup(); },//function(response) function(error)//ok { alert('getting list of cards = '+error); }//function(error) )//then });//meter_select.on
for reason, combobox wants explicit id. i'm guessing there's id conflict going on somewhere: http://jsfiddle.net/9tnhn/13/
here's relevant change:
combx = new combobox({ store: memostore2, searchattr: "mfg_code", id: "some_unique_id" }, "node_cardselect");
update: id field need use in registry.byid(); id after constructor arguments it's placed in dom. updated jsfiddle: http://jsfiddle.net/9tnhn/14/
Comments
Post a Comment