1 //Administrative divisions-local province2 varIdprovince = ext.create (' Ext.form.field.ComboBox '), {3 //Store:states3,4Querymode: ' Remote ',5Renderto: ' Idtagprovince ',6ID: ' Idprovince ',7Editablefalse,8Name: ' Province ',9Width: ' 100% ',TenValuefield: ' Value ', OneDisplayfield: ' Text ', AStore:Ext.create (' Ext.data.Store ',{ -fields:[' value ', ' text '], - proxy:{ theType: ' Ajax ', -Url:getpath () + '/expertlibcontroller.json?getareabyid=true&id=-1 ', - reader:{ -Type: ' JSON ', +Root: ' Data ' - } + } A }), at listeners:{ - select:{ -Fn:function(combo,records) { - if(Combo.getvalue ()) { -EXT.GETCMP (' idcity '). SetValue (' '); -EXT.GETCMP (' idcity '). Setreadonly (false); inEXT.GETCMP (' iddistrict '). SetValue (' '); -EXT.GETCMP (' iddistrict '). Setreadonly (true); to varurl = getpath () + '/expertlibcontroller.json?getareabyid=true&id= ' +Combo.getvalue (); +EXT.GETCMP (' idcity '). GetStore (). Proxy.url =URL; -EXT.GETCMP (' idcity '). GetStore (). Load (); the}Else{ * /*ext.getcmp (' idcity '). SetValue ('); $ ext.getcmp (' idcity '). GetStore (). Proxy.url = ';Panax Notoginseng ext.getcmp (' iddistrict '). SetValue ('); - ext.getcmp (' iddistrict '). GetStore (). Proxy.url = ';*/ the } + } A } the }, +Validatorfunction(obj) { - if(!obj) $ return"Content cannot be empty"; $ return true; - } - }); the Formx1.add (idprovince); - Wuyi //Administrative area-City the varidcity = ext.create (' Ext.form.field.ComboBox '), { -Querymode: ' Remote ', WuRenderto: ' Idtagcity ', -ID: ' Idcity ', AboutEditablefalse, $Name: ' City ', -Width: ' 100% ', -Valuefield: ' Value ', -Displayfield: ' Text ', AStore:Ext.create (' Ext.data.Store ',{ +fields:[' value ', ' text '], the proxy:{ -Type: ' Ajax ', $URL: ", the reader:{ theType: ' JSON ', theRoot: ' Data ' the } - } in }), the listeners:{ the select:{ AboutFn:function(combo,records) { the if(Combo.getvalue ()) { theEXT.GETCMP (' iddistrict '). SetValue (' '); theEXT.GETCMP (' iddistrict '). Setreadonly (false); + varurl = getpath () + '/expertlibcontroller.json?getareabyid=true&id= ' +Combo.getvalue (); -EXT.GETCMP (' iddistrict '). GetStore (). Proxy.url =URL; theEXT.GETCMP (' Iddistrict '). GetStore (). Load ();Bayi}Else{ the /*ext.getcmp (' iddistrict '). SetValue ('); the ext.getcmp (' iddistrict '). GetStore (). Proxy.url = ';*/ - } - } the } the }, theValidatorfunction(obj) { the if(!obj) - return"Content cannot be empty"; the return true; the } the });94 the the Formx1.add (idcity); the //Administrative divisions-counties of the country98 varIddistrict = ext.create (' Ext.form.field.ComboBox '), { AboutQuerymode: ' Remote ', -Renderto: ' Idtagdistrict ',101ID: ' Iddistrict ',102Name: ' District ',103Editablefalse,104Valuefield: ' Value ', theDisplayfield: ' Text ',106Width: ' 100% ',107Store:Ext.create (' Ext.data.Store ',{108fields:[' value ', ' text '],109 proxy:{ theType: ' Ajax ',111URL: ", the reader:{113Type: ' JSON ', theRoot: ' Data ' the } the }117 }),118Validatorfunction(obj) {119 return true; - }121 });122Formx1.add (iddistrict);
ExtJS cascade of ComboBox in 4+