Initially when UI grid loads the data, I want to show first row as selected. I found one issue -
I am calling this public API
$scope.gridApi.selection.selectRow(row);
This method internally calls toggleRowSelection and multiSelect, noUnselect are false in my case.
toggleRowSelection: function (grid, row, evt, multiSelect, noUnselect)
var selected = row.isSelected; // undefined afer loading the grid
In the above method, i am able to see selected value is "undefined" after initializing the grid.
Therefore, code goes into following if block and which clears the row.
if (!multiSelect && !selected)
However, the code should first check whether is it undefined or not. Either, there should be some different API for selecting row. Using togle is issue.
Initially when UI grid loads the data, I want to show first row as selected. I found one issue -
I am calling this public API
$scope.gridApi.selection.selectRow(row);
This method internally calls toggleRowSelection and multiSelect, noUnselect are false in my case.
toggleRowSelection: function (grid, row, evt, multiSelect, noUnselect)
var selected = row.isSelected; // undefined afer loading the grid
In the above method, i am able to see selected value is "undefined" after initializing the grid.
Therefore, code goes into following if block and which clears the row.
if (!multiSelect && !selected)
However, the code should first check whether is it undefined or not. Either, there should be some different API for selecting row. Using togle is issue.