有没有写过COMBOX拓展的。
我急需一个combox的拓展,来拿到combox分页模式下的,翻页动作。具体需求是这样的:
     我的combox的数据要是从本地XML里读取。现在的情况就是,数据量大的时候,combox加载速度过慢。
     我的想法是,在把XML转化成数组时,就进行分页读取。然后是,通过取到combox的分页工具条上的翻页事件,来reload数据。

解决方案 »

  1.   

    把xml转化为json数据格式,貌似是可以限制每页显示多少数据的,就类似于grid中每页显示多少内容是可以指定的,我记不太清了,你可以查一查
      

  2.   

    谢谢回复。不过,我想要的是怎么样能拿到combox组件上分页工具条的那几个按钮的触发事件。
      

  3.   


    combo源码里面不是有分页的吗?
     this.pageTb = new Ext.PagingToolbar({
                        store: this.store,
                        pageSize: this.pageSize,
                        renderTo:this.footer
                    });源码
    或者你继承combox里面放个grid也可以的
      

  4.   

    回#3楼的:
         我知道combox里配一个pagesize就能分页。
         不过,我现在是要拿到这个分页工具条所触发的事件。比如:点击下一页时,能调用我的function来加载新的数据。
         
         至于继承,我也参考网上的来玩过。还是没拿到那些事件。
         要是,您方便的话,再给我进行指导一下吧 我才玩EXT的
      

  5.   

    本地数据,变成数组形式,很快的,
    要不就做一个下拉grid吧
      

  6.   

    回#5樓的:
           我的做法就是把XML讀成數組了。
           現在的問題就是,數據量大的時候,一次性加載進來的話,那是相當地慢。所以就是想用分頁讀入數組。
      

  7.   

    what about the PagingToolbar's beforechange  or change event ?
    var pt = new  Ext.PagingToolbar(....;
    pt.on('Ext.PagingToolbar',function(toolbar,param){});
      

  8.   

    wrong
    var pt = new  Ext.PagingToolbar(....;
    pt.on('beforechange' ,function(toolbar,param){});
      

  9.   

    asdujiayong您好:
    我的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。所以我不知道怎么应用您的那些代码
    还望不吝指教。谢谢
      

  10.   

    here ,I give some advice .
    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.
      

  11.   

    嘗試拓展combox中
    還在無限次失敗中。沒用過EXT拓展