ExtJs4.0 下拉框聯動

來源:互聯網
上載者:User
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.       

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.