We're using 2016.1. We're also using the igGridSelection event rowSelectionChanging to control whether or not a row gets selected when clicked. This seems to work fine. However, when clicking a different row in the igGrid, the currently selected row is automatically de-selected (even if our code prevents the newly clicked row from being selected). How can we prevent a row from being automatically de-selected when clicked?
I'm glad to hear that you've managed to resolve it.
I have found a work-around for my problem. When clicking a row in a child grid other than the child grid where a row is currently selected, I force the currently selected row to be re-selected programmatically. This seems to work just fine.
Sorry, I left out an important piece of information - we are actually using an igHierarchalGrid. This works as you describe when working with a single child igGrid within the igHierarchicalGrid.
However, we need for this to work across the entire igHierarchicalGrid. If a row is selected in one child igGrid and the user clicks a row in another child igGrid, the rowSelectionChanging is correctly preventing the clicked row from being selected. However, the row currently selected in a different child igGrid is automatically deselected. We want the row to remain selected.
Hello,
returning false in rowSelectionChanging will prevent deselecting the previous row and selecting the clicked one.
For example:
rowSelectionChanging: function (e, ui) { if(ui.row.index === 0) { return false; } }