【问题标题】:paging toolbar events in ExtJS4ExtJS4 中的分页工具栏事件
【发布时间】:2011-07-25 03:39:58
【问题描述】:

我们正在迁移到 ExtJS4。但是我们面临分页工具栏事件(onClick 和 onPagingKeyDown)的问题。这两个正在与 ExtJS3 一起使用。但是现在这些都不起作用了。

ExtJS3 代码为:

var grid = new Ext.grid.GridPanel({      
store : examplestore,
columns : [{
header : s.no,
width : 40
},{
header : company name,
width : 100
},{
header : address,
width : 150
}],
bbar: new Ext.PagingToolbar({
pageSize : 10,
store : examplestore,
width : 350,
onClick : function(){
alert('you have clicked');
},
onPagingKeyDown : function(){
alert('hello');
}
})
});

ExtJS4 代码为:

var grid = Ext.create('Ext.grid.GridPanel',{      
    store : examplestore,
    columns : [{
    header : s.no,
    width : 40
    },{
    header : company name,
    width : 100
    },{
    header : address,
    width : 150
    }],
    bbar: Ext.create('Ext.toolbar.Paging',{
    pageSize : 10,
    store : examplestore,
    width : 350,
    onClick : function(){
    alert('you have clicked');
    },
    onPagingKeyDown : function(){
    alert('hello');
    }
    })
    });

现在我们面临一个ExtJS4中没有的onClick和onPagingKeyDown事件的问题。如何实现这两个事件?

我们将不胜感激。

【问题讨论】:

    标签: extjs extjs4 extjs3


    【解决方案1】:

    onPagingKeyDown 在 ExtJS4 中。但它是私有的,不建议使用它。您可以使用 beforechange 事件来代替 onClickonPagingKeyDown

    【讨论】:

    • 是的,我尝试使用 befirechange 事件。但我得到了使用 onClick 和 onPagingKeyDown 获得的预期结果。如果您有任何示例,请与我们分享。
    • 是的,感谢我们的回复分子。我们得到了解决方案。我们使用了更改侦听器而不是 beforechange。现在它工作正常。非常感谢。
    猜你喜欢
    • 1970-01-01
    • 2012-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多