I have dojox.grid.DataGrid where I want to select a row programmatically. I am using setSelected () for this and it works for the first time. However, by calling it a second time for another line, you highlight the previous line. Also, if I try to reselect a row that was previously selected, the onSelected event does not fire. But if I actually clicked in the grid, it will clear things: the lines that were highlighted in the grid before getting immeasurable and unselected.
The code looks like this:
if (grid.rowCount > 0 && idx < grid.rowCount) { grid.selection.setSelected(idx, true); grid.render(); }
As if I have multi-select enabled, but I declared the grid as selectionMode = "single".
<table dojoType="dojox.grid.DataGrid" id="hotTablesForAppDg" autoWidth="true" autoHeight="true" selectionMode="single" onSelected="autonomics.Clusters.loadTableDetails(this)">
Is there anything else I need to clear my previous selection?
source share