ExtJS cascade of ComboBox in 4+

Source: Internet
Author: User

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+

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.