I have a grid and a button that makes me select all the rows of this grid (mygrid.getSelectionModel().selectAll()) But i want that when all the rows are selected and i click to this button it deselct all the rows. How can i do it ?
Thank you for helping
instead of using clearSelections() use deselectAll() as the former is now deprecated.
new Ext.Button({
enableToggle:true,
toggleHandler:function(btn,state){
var grid = Ext.getCmp(YOURGRIDID),
if(state==true){
grid.getSelectionModel().selectAll()
}else{
grid.getSelectionModel().deselectAll()
}
}
})