Shenjk

天地生人,有一人应有一人之业;人生在世,生一日当尽一日之勤

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
代码
        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); //初始化显示
                }
            }

        })

 

http://www.webexpoer.com

posted on 2010-05-25 17:53  shenjk  阅读(1481)  评论(0编辑  收藏  举报