简体   繁体   English

Ext JS 4.2分页组合-如何跳至页面

[英]Ext JS 4.2 paging combo - how to skip to page

I have a Combo such as: 我有一个组合,例如:

{
        xtype : 'combo',
        anchor : '70%',
        id : 'companyCombo',
        fieldLabel : 'Company',
        name : 'COMPANY_ID',
        store: companyStore,
        pageSize: 25,
        displayField : 'COMPANYNAME',
        valueField : 'COMPANY_ID',
        typeAhead : true,
        queryMode : 'local',
        forceSelection : true,
        allowBlank : false,
        editable : true
},

When using a paging Combo Box with Ajax data, I am advised to first determine (via Ajax) which 'page' the current item is on, and then set the Combo's page to that via: 当使用带有Ajax数据的分页组合框时,建议首先(通过Ajax)确定当前项位于哪个“页面”上,然后通过以下方式将Combo的页面设置为该页面:

pagingtoolbar.move(pageNumber)

The problem is, I'm not sure how to get a reference to pagingtoolbar for the Combo. 问题是,我不确定如何获取Combo的pagingtoolbar的引用。 It doesn't seem to correspond to any of the member fields of the object returned via Ext.getCmp('companyCombo') ... 它似乎不对应于通过Ext.getCmp('companyCombo')返回的对象的任何成员字段。

The toolbar is on the combo's picker, not the combo itself. 工具栏位于组合的选择器上,而不是组合本身。 Try this: 尝试这个:

var combo   = Ext.getCmp('companyCombo'),
    toolbar = combo.getPicker().pagingToolbar;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM