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’);
}
});
What is the difference between the page it is working on and the page it is failing on?
There are virtually no differences, I duplicated the popup from the working instance in the new page piece by piece (extra models/fields and all)
The only thing I can think of is that the new one is one step further removed from the actual page. The original is a popup that is triggered by a button on the main page, the new one is a button that is on a popup already. I’m using the unique Ids of the tables to run the javascript and it is successfully running in part though so I don’t think that’s the issue.
Can you paste the XML of the page it is NOT working on then post the XML of the page it is working on?
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.