只有远程数据的时候,下来框数据显示如下:
[url=http://hongfanshu.blogbus.com/][img]http://dl.iteye.com/upload/attachment/346468/2f3ae771-4718-3cc2-a256-0bf8f79c9c74.jpg[/img][/url]
添加以下代码
//在下拉框增加一行
此时的下拉框数据显示如下:
[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]逛逛
[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]逛逛