Currently, I am utilizing smart-table and facing the need to preselect a specific row.
After loading my list, I iterate through it and set the isSelected
attribute once I locate the item I intend to select:
// Preselecting a row
for (var i = 0, len = scope.displayCollection.length; i < len; i += 1) {
var person = scope.displayCollection[i];
if (person.firstName === 'Blandine') {
person.isSelected = true;
scope.selected = person;
break;
}
}
Although this process works well, I encounter an issue when attempting to select another row. The previously preselected row remains selected, requiring me to manually deselect it before selecting a new row.
To further illustrate the problem, here is a JSFiddle link: http://jsfiddle.net/6pykn5hu/3/
I have also attempted the solution suggested in Smart-Table - Select first row displayed (angularjs) with no success.
Any assistance on resolving this issue would be greatly appreciated. Thank you.