简体   繁体   English

ExtJS4中的分页工具栏事件

[英]paging toolbar events in ExtJS4

We are moving to ExtJS4.But we are facing an issue with paging toolbar events(onClick and onPagingKeyDown).These two are working with ExtJS3.But now these are not working. 我们正在使用ExtJS4,但是我们面临着分页工具栏事件(onClick和onPagingKeyDown)的问题,这两个正在使用ExtJS3,但是现在它们不起作用了。

ExtJS3 code is: 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 code is: 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');
    }
    })
    });

Now we are facing an issue with these onClick and onPagingKeyDown events that are not in ExtJS4.How to achieve these two events? 现在我们遇到了ExtJS4中没有的onClick和onPagingKeyDown事件的问题,如何实现这两个事件?

Help would be appreciated. 帮助将不胜感激。

onPagingKeyDown is in ExtJS4. onPagingKeyDown在ExtJS4中。 But it is private and it's not recommended to use it. 但是它是私有的,不建议使用它。 Instead of both onClick and onPagingKeyDown you can use beforechange event. 您可以使用beforechange事件来代替onClickonPagingKeyDown

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

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