ExtJs3.2.2 Combobox同时加载本地数据及远程数据

只有远程数据的时候,下来框数据显示如下:
[url=http://hongfanshu.blogbus.com/][img]http://dl.iteye.com/upload/attachment/346468/2f3ae771-4718-3cc2-a256-0bf8f79c9c74.jpg[/img][/url]
添加以下代码
//在下拉框增加一行
 labelCatSearchDs.on('load',function(store,record,options){
store.insert(0,[new Ext.data.Record({'labelName':'全部显示','id':0})]);
});

此时的下拉框数据显示如下:
[url=http://hongfanshu.blogbus.com/][img]http://dl.iteye.com/upload/attachment/346470/7eb3143e-342b-3e89-b941-74eeb8fa37f9.jpg[/img][/url]

说明:
1.insert方法中 第一个参数指定该记录显示的位置,0表示顶端
2.在ExtJS 3.3API中:
Record( [Object data], [Object id] )
[b]This constructor should not be used to create Record objects[/b]. Instead, use create to generate a subclass of Ext.data.Record configured with information about its constituent fields.
3.load:在远程加载完数据后,触发该事件。
说将不用该构造器来创建Record对象,推荐用create方法。

有空,欢迎到[url=http://hongfanshu.blogbus.com/]红番薯[/url]逛逛
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值