grid.onSelectedRowsChanged.subscribe(function(){
var selectedRows = grid.getSelectedRows();
if (selectedRows.length === 0) {
// (when all rows are deselected)
// your logic goes here...
}
});
If you want to execute logic on any row deselect I suggest storing selectedRows in global variable which would be updated on SelectedRowsChanged event. Also in onSelectedRowsChanged you could compare your global selectedRows variable and grid.getSelectedRows() lenghts to see if any changes have occured.
var lastSelectedRows = [];
grid.onSelectedRowsChanged.subscribe(function(){
var selectedRows = grid.getSelectedRows();
if (selectedRows.length < lastSelectedRows.length ) {
// proceed in finding the actual row by comparing the two arrays
// the rest of the logic goes here...
}
lastSelectedRows = selectedRows;
});
!Note that I'm new in the world of Slickgrid and this may not be the best solution. I just think it's worth a try.