I’m using a row action to populate a temporary model when a row is ‘selected’. I set up the row action to execute a javascript snippet that should
select(highlight) a row if none are already selected when it’s chosen
unselect(unhighlight) a row if it’s chosen a second time
or unselect(unhighlight) the previous row and select(highlight) the new row if a different one is chosen
I had this working in a different place in one of our other skuid pages, but for the current page it seems to only behave if you are hitting the row action on one of the even numbered rows…
Here is the javascript
AssociatedModel.abandonAllRows();
$.each(params.item.list.renderedItems, function(i, listItem){
if(listItem.row.Id === contextRowId){
if(alreadyHighlighted === false){
listItem.element.addClass(‘highlighted-row’);
console.log(‘alreadyHighlighted was false’);
AssociatedModel.adoptRows([listItem.row]);
UIModel.updateRow(UIModel.getFirstRow(), {
addField: true,
createField: false
});
rowSelected = true;
} else {
listItem.element.removeClass(‘highlighted-row’);
rowSelected = false;
}
}else{
listItem.element.removeClass(‘highlighted-row’);
}
});
Question
row action misbehaving on odd numbered rows
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.