PDA

View Full Version : Display how many rows selected in pagingtoolbar .



shakerkk
18 Sep 2014, 5:59 AM
Hello guys , i`m trying to display in pagingtoolbar , how many rows are selected in my table and i dont really now how, can you give me some suggestions ?

For exemple : i have a grid with 25 rows with checkbox when i check 1 or more in my pagingtoolbar i'd like to show 1 or more rows are selected...:-?
Sorry for my english .

scottmartin
18 Sep 2014, 9:30 AM
You can use the following to get selections



grid.getSelectionModel().getSelection()

shakerkk
18 Sep 2014, 10:56 PM
in my context i use it, but the problem comes when i need to show in pagingtoolbar how many are selected :-?

scottmartin
19 Sep 2014, 11:20 AM
You can simply add items to the toolbar like this:


dockedItems: [{
xtype: 'pagingtoolbar',
store: store, // same store GridPanel is using
dock: 'bottom',
displayInfo: true,
items : [{
xtype : 'button',
text : 'Button'
}]
}],


Or, You can create an override make the changes you need :: see getPagingItems()

shakerkk
21 Sep 2014, 11:17 PM
So , my best option is to overide Ext.toolbar.Paging :-? and add there items i need :)...