有没有写过COMBOX拓展的。
我急需一个combox的拓展,来拿到combox分页模式下的,翻页动作。具体需求是这样的:
我的combox的数据要是从本地XML里读取。现在的情况就是,数据量大的时候,combox加载速度过慢。
我的想法是,在把XML转化成数组时,就进行分页读取。然后是,通过取到combox的分页工具条上的翻页事件,来reload数据。
我急需一个combox的拓展,来拿到combox分页模式下的,翻页动作。具体需求是这样的:
我的combox的数据要是从本地XML里读取。现在的情况就是,数据量大的时候,combox加载速度过慢。
我的想法是,在把XML转化成数组时,就进行分页读取。然后是,通过取到combox的分页工具条上的翻页事件,来reload数据。
combo源码里面不是有分页的吗?
this.pageTb = new Ext.PagingToolbar({
store: this.store,
pageSize: this.pageSize,
renderTo:this.footer
});源码
或者你继承combox里面放个grid也可以的
我知道combox里配一个pagesize就能分页。
不过,我现在是要拿到这个分页工具条所触发的事件。比如:点击下一页时,能调用我的function来加载新的数据。
至于继承,我也参考网上的来玩过。还是没拿到那些事件。
要是,您方便的话,再给我进行指导一下吧 我才玩EXT的
要不就做一个下拉grid吧
我的做法就是把XML讀成數組了。
現在的問題就是,數據量大的時候,一次性加載進來的話,那是相當地慢。所以就是想用分頁讀入數組。
var pt = new Ext.PagingToolbar(....;
pt.on('Ext.PagingToolbar',function(toolbar,param){});
var pt = new Ext.PagingToolbar(....;
pt.on('beforechange' ,function(toolbar,param){});
我的combox初始化是这样的:
var strInfo1 = new Array();
strInfo1 = XmltoArray("TEST");//XmltoArray()方法是去读取XML文件的。
var strValue = new Ext.data.ArrayStore({
fields: ['state'],
data : strInfo1
});
var managerList = new Ext.form.ComboBox
({
store: strValue,
displayField:'state',
valueField:'state',
typeAhead: true,
xtype: 'combo',
mode: 'remote',
id:'EXT_C_DPT_CDE',
name:'EXT_C_DPT_CDE',
forceSelection: true,
triggerAction: 'all',
emptyText:'',
selectOnFocus:true,
editable:true,
width:150,
renderTo:'DIV_TEST',
resizable:true,
pageSize:10
});还有,我只需要一个带autocomplete的combox。所以我不知道怎么应用您的那些代码
还望不吝指教。谢谢
1.you can extend a new combobox add a change event using the code to implement your requirement
2.you can use combobox's store ,if you want to change to next page,it will fire
store's event ,try to use store's event
3.you can try to find combobox's pagingToolBar ,I think that there must be a pagingToolbar in the paging combox, if you can find it ,it will be easy,
I didn't try to find pagingToolBar in the past ,so it need you to find the pagingToolbar by yourself.
還在無限次失敗中。沒用過EXT拓展