ext 清楚Stor 及联动效果

1、editForm.form.reset();
var sore=Ext.getCmp('csCustContDet_linkManGrid_pbop').getStore()
sore.removeAll();
2、  var regionResult=Main.jsonRpcClient._call('areaService.getAreaList','1');
      if(regionResult){
        regionStore.loadData(regionResult.list); 
      }
   var provinceResult=Main.jsonRpcClient._call('areaService.getAreaList','2');
      if(provinceResult){
        provinceStore.loadData(provinceResult.list); 
      }
   var cityResult=Main.jsonRpcClient._call('areaService.getAreaList','3');
      if(cityResult){
        cityStore.loadData(cityResult.list); 
      }
var districtResult=Main.jsonRpcClient._call('areaService.getAreaList','4');
      if(districtResult){
        districtStore.loadData(districtResult.list); 
      }
Form = function(object){
var area = new Ext.form.ComboBox({
store:regionStore,
    valueField :"regionID",
displayField: "regionName",
width:120,
emptyText : "-未选择-",
        listEmptyText:'-未选择-',
hiddenName:'regionID',
mode: 'local',
triggerAction : 'all',
forceSelection: true,
readOnly:true,
fieldLabel: '大区',
anchor: '90%'
   });
area.on('select',function(comboBox){
province.reset();
city.reset();
district.reset();
          var areaID = comboBox.getValue();
            var provinceResult=Main.jsonRpcClient._call('areaService.getAreaByParentID',areaID);
           if(provinceResult){
              provinceStore.loadData(provinceResult.list);       
           }
           pickUpareaID = areaID;
       });
var province = new Ext.form.ComboBox({
store:provinceStore,
valueField :"provinceID",
displayField: "provinceName",
width:120,
emptyText : "-未选择-",
        listEmptyText:'-未选择-',
hiddenName:'provinceID',
mode: 'local',
triggerAction : 'all',
forceSelection: true,
readOnly:true,
fieldLabel: '省份',
anchor: '90%'
});
province.on('select',function(comboBox){
    city.reset();
district.reset();
          var provinceID = comboBox.getValue();
             var cityResult=Main.jsonRpcClient._call('areaService.getAreaByParentID',provinceID);
            if(cityResult){
              cityStore.loadData(cityResult.list);       
          }
          pickUpareaID = provinceID;
       });
var city = new Ext.form.ComboBox({
store:cityStore,
valueField :"cityID",
displayField: "cityName",
width:120,
emptyText : "-未选择-",
        listEmptyText:'-未选择-',
hiddenName:'cityID',
mode: 'local',
triggerAction : 'all',
forceSelection: true,
readOnly:true,
fieldLabel: '城市',
anchor: '90%'
  });
  city.on('select',function(comboBox){
    district.reset();
          var cityID = comboBox.getValue();
          var distirctResult=Main.jsonRpcClient._call('areaService.getAreaByParentID',cityID);
          if(distirctResult){
              districtStore.loadData(distirctResult.list);       
          }
          pickUpareaID = cityID;
       });
       var district = new Ext.form.ComboBox({
store:districtStore,
valueField :"districtID",
displayField: "districtName",
width:120,
emptyText : "-未选择-",
        listEmptyText:'-未选择-',
hiddenName:'districtID',
mode: 'local',
triggerAction : 'all',
forceSelection: true,
readOnly:true,
fieldLabel: '区县',
anchor: '90%'
  });
  district.on('select',function(comboBox){
          pickUpareaID = comboBox.getValue();
       });
3、colseActiveTab();
4、tabs.hide();

你可能感兴趣的:(ext)