ExtJs4.0 下拉框联动

Combox.js代码   收藏代码
  1. /**  
  2. * @class Ext.app.AdSiteGrid  
  3. * @extends Ext.grid.GridPanel  
  4. * 内容项Add  
  5. */  
  6. Ext.define('ctiWsSort', {  
  7.     extend: 'Ext.data.Model',  
  8.     fields: [  
  9.             { type: 'string', name: 'Id' },  
  10.             { type: 'string', name: 'Name' }  
  11.            ]  
  12.     });  
  13.     
  14.             wsStore = Ext.create('Ext.data.Store', {  
  15.                 model: 'ctiWsSort',  
  16.                 proxy:  
  17.                  {  
  18.                      type: 'ajax',  
  19.                      url: 'Data/WebServiceComboxData.json',  
  20.                      reader: { type: 'json', root: 'data' },  
  21.                      fields: ['Id''Name']  
  22.                  },  
  23.                 listeners:  
  24.                     {  
  25.                         'load': function (me, record, successful) {  
  26.                             if (successful) {  
  27.                                 var combSort = Ext.getCmp('ctcEditTableName');  
  28.                                 combSort.setValue(combSort.getValue());  
  29.                             }  
  30.                         }  
  31.                     },  
  32.                 autoLoad: true  
  33.             });  
  34.                     {  
  35.                         xtype: 'combo',  
  36.                         fieldLabel: 'Web Service接口',  
  37.                         allowBlank: false,  
  38.                         blankText: "此项不能为空",  
  39.                         id: 'ctiEidtWebServie',  
  40.                         name: 'wsName',  
  41.                         typeAhead: true,  
  42.                         displayField: "text",  
  43.                         valueField: "value",  
  44.                         queryMode: 'local',  
  45.                         store: new Ext.data.SimpleStore({  
  46.                             fields: ["text""value"],  
  47.                             data: [["热点新闻接口""1"], ["产品库存接口""2"], ["新闻维护接口""3"]]  
  48.                         }),  
  49.                         listeners: {  
  50.                             "select": function (combo, record, index) {  
  51.                                 alert(combo.value);  
  52.                                 wsStore.proxy.url = 'Data/WebServiceComboxData2.json';  
  53.                                 wsStore.load();  
  54.                             }  
  55.                         }  
  56.                     },  
  57.                     {  
  58.                         xtype: 'combo',  
  59.                         fieldLabel: "数据库表名",  
  60.                         blankText: "此项不能为空",  
  61.                         allowBlank: false,  
  62.                         id: "ctcEditTableName",  
  63.                         name: "TableName",  
  64.                         displayField: "Name",  
  65.                         valueField: "Id",  
  66.                         queryMode: 'local',  
  67.                         typeAhead: true,  
  68.                         store: wsStore  
  69.                     }  
  70.       
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值