i have response json string returned first fs(filteringselect) contents of second , can't make load it. i've tried store.clearonclose , doesn't work , javascript valid. how do ? here code form 2 filteringselects:
$category=new zend_dojo_form_element_filteringselect("category"); $category->setlabel("category"); $category->setattrib("id","category") ->setattrib("onchange"," var cat=dojo.query('#category ')[0].value; dojo.xhrpost({ url: 'getsubcategories', handleas: 'text', content: { category:cat } , load: function(data, ioargs) { var store=subcatstore.store; store.data=data; store.close() }, error: function(data,ioargs) { if(typeof data== 'error'){ console.warn('error'); console.log(ioargs); } } }); " ); $category->setoptions(array( "autocomplete"=>false, "storeid"=>"category", "storetype"=>"dojo.data.itemfilereadstore", "storeparams"=>array("url"=>"getcategories"), "dijitparams"=>array("searchattr"=>"name") ) ) ->setrequired(true); $subcategory=new zend_dojo_form_element_filteringselect("subcategory"); $subcategory->setlabel("sub category") ->setattrib("id","subcategory"); $subcategory->setoptions(array( "autocomplete"=>false, "storeid"=>"subcatstore", "jsid"=>"subcatstore", "storetype"=>"dojo.data.itemfilereadstore", "storeparams"=>array("clearonclose"=>true,"url"=>"getsubcategories"), "dijitparams"=>array("searchattr"=>"name"))) ->setrequired(true);
i've red on net way , element of 2nd dropdown , passed values when 1st changes. wrong ? tnx attention.
i dont know zf, how in js :
new dijit.form.filteringselect({ id: "country", name: "country", store: countrystore, required: false, onchange: function(country) { dijit.byid('state').query.countryid = country ; }, searchattr: "name" },"country");
Comments
Post a Comment