当前位置: 代码迷 >> Web前端 >> Ext.ComboBox 设立初始值
  详细解决方案

Ext.ComboBox 设立初始值

热度:59   发布时间:2012-10-08 19:54:56.0
Ext.ComboBox 设置初始值
new Ext.form.ComboBox({
            id: 'mycmb',
            typeAhead: true,
            triggerAction: 'all',
            mode: 'local',
            valueField: 'ID',
            displayField: 'Name',
            value: '5307',//设置值           
            store: new Ext.data.JsonStore({
                proxy: new Ext.data.HttpProxy({
                    method: 'GET',
                    url: 'GoodsList.aspx'//相对路径
                }),
                fields: [{ name: 'ID' }, { name: 'Name'}],
                root: 'data',
                autoLoad: true
            }),
            listeners: {
                render: function(cmb) {
                    var store = this.getStore();
                    store.on('load', function() { cmb.setValue(cmb.getValue()); }, this); //初始化显示
                }
            }

        })
  相关解决方案