我需要检测extjs 4.2中pagingtoolbar的页面输入字段中页面更改的变化。 我正在查看文档,但找不到任何方法。我已成功覆盖下一个、上一个等按钮,但找不到任何内容来覆盖页面输入字段。你会怎么做?
最佳答案
我在 ExtJS Combobox 组件上添加了 afterrender 监听器。您可以相应添加以覆盖分页工具栏的输入字段。这是工作代码:
'afterrender' : function(thisCombo){
thisCombo.getPicker().pagingToolbar.addListener('change', function() {
var me = this;
thisCombo.getPicker().pagingToolbar.child("#inputItem").addListener('specialkey', function(field, e) {
if (e.getKey() == e.ENTER) {
///// Do your modifications here
var inputItem = thisCombo.getPicker().pagingToolbar.child('#inputItem').getValue();
total = me.getPageData().pageCount;
if (inputItem <= total) {
if (me.fireEvent('beforechange', me, inputItem) !== false) {
me.store.inputItemPage({
// Enter params
});
}
}
}
});
});
}
}
关于javascript - 使用 extjs 4.2 覆盖 pagingtoolbar 中的页面输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23683897/