I tend to explore the API via the dev console in Chrome, and here’s what I’ve done:
var mytable = skuid.$(“#my-table”).data(“object”); to get the table
mytable.list.renderedItems; to look at the items
mytable.list.renderedItems[“18charID”]; to look at a specific item - hey look, there’s a selected property!
mytable.list.renderedItems[“18charID”].selected = true; doesn’t appear to do anything in the UI. Maybe we need to…
mytable.list.render({doNotCache:true}); Doesn’t do anything either. In fact it resets the selected property to false.
Variations on the above - visibleitems rather than renderedItems, and the render call with/without doNotCache and also refreshFields
The above seems in line with Zach’s answer in the answer linked to above, and I’ve actually tested it in the console to make sure it does de-select the row. Anything obvious I’m missing?
Yes, after setting selected to true, outputting the property to the console shows it is true. After the call to render however, it reverts to false. Which makes me think that I’m not setting selected in the right place (or maybe I need to do something other than render?), but I can’t see any part of the API that I could use to set it to being selected.
I look at the data in the row and then use click() to select it if the conditions mean it needs to be clicked.
It feels a little odd, as it’s faking the click event, whereas it feels like I should be able to update the underlying data and have the Skuid API keep things up to date for me. But this works for now, in case anybody else if looking for something similar.