ext下拉框联动

第一个下拉列表框的监听事件:定义全局变量:var ryflByBeforeLoad=null。

listeners:{
     "select":function(combo, record,index){
      ryflByBeforeLoad=Ext.getCmp("khIndex_ryfl").getValue();   //得到当前所选的值,
      var aaa=Ext.getCmp("kaoheXMList");
      aaa.value="";  
      aaa.store.proxy=new Ext.data.HttpProxy({url:'khIndex!getListByRyfl.do?name='+encodeURI(encodeURI(ryflByBeforeLoad))});  
      aaa.store.reload();    
     }
 }

 

 

二级下拉列表框的store:

store:new Ext.data.SimpleStore({
         id:"childStore",
         proxy:new Ext.data.HttpProxy({
          url:"" 
         }),      
         fields:["id","kaoheXM"],     
         listeners:{     
          "beforeload":function(){
           var cc=Ext.getCmp("khIndex_ryfl").getValue();
             if(cc==null||cc==""){
              var aaa=Ext.getCmp("kaoheXMList"); 
              aaa.store.removeAll();         
              Ext.Msg.alert("提示","请先选择*****");
              return;        
             }             
          }
         }
        }),

你可能感兴趣的:(function,ext,null,url)