简体   繁体   中英

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.

ExtJS3 code is:

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:

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?

Help would be appreciated.

onPagingKeyDown is in ExtJS4. But it is private and it's not recommended to use it. Instead of both onClick and onPagingKeyDown you can use beforechange event.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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