Getting the selected records on a table without using mass/row action and instead using a button


When starting a snippet using code such as that shown below, is it possible to pull in selected items from a table by clicking on a title button that launches a snippet or does the snippet always have to be run from a mass action or row action on the table?

Cheers guys!

var params = arguments[0], $ = skuid.$, items = params.item ? [params.item] : params.list.getSelectedItems()<br>

Yes, you just need to get a reference to the Table’s list. This is doable several ways, but the easiest way is to give your Table a Unique Id, e.g. “MyTable”, and then you could call this from your button:

var table = skuid.$(‘#MyTable’),
if (table.length) {
   list =‘object’).list;
   items = list.getSelectedItems();

Worked a treat!

Cheers Zach. This will be tremendously useful.

Needed this code tonight – Thanks!!!