Hi everyone,
I have a table, and I’d like to select some of the rows from within some Javascript code, but I just can’t seem to get it to work.
I’ve seen this response here which handles de-selecting rows, which makes me think my approach is not crazy, but extending this example doesn’t appear to do what I need it to: https://community.skuid.com/t/snippet-code-to-deselect-selected-table-rows
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.renderedItemsb“18charID”]; to look at a specific item - hey look, there’s a selected property!
- mytable.list.renderedItemsi“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