Javascript for rows that are checked in a table?

I need to write some code to run a loop only on the rows that are checked in a table. How do I reference the checked table rows in javascript?

You’ll need to give your table a unique name e.g. my-table.

var myTable = skuid.$('#my-table').data('object');<br>var selectedItems = list.getSelectedItems();<br>$.each(selectedItems, function (i, item) {<br>&nbsp; &nbsp; console.log(i + ' - ' + item);<br>});

Thanks Irvin

Another Community post that might be helpful here:…

And here’s the documentation on writing Mass Action Snippets, which leverage the “getSelectedItems()” behavior Irwin described:

Thanks everyone! We got it working as a mass action…

var params = arguments[0], $ = skuid.$,
    action = arguments[0].action,
    list = arguments[0].list,
    model = arguments[0].model,
    selectedItems = list.getSelectedItems();

var SessionModelId=skuid.model.getModel(“MMA_Academy_Student_Event_Session_included”).data[0].Id;

if(SessionModelId) {

    var SessionPerformerModel=skuid.model.getModel(“MMA_Academy_Student_Event_Session_Perfor”);

    $.each( selectedItems,
        function( i, item )
            var row = item.row;
            var newRow=SessionPerformerModel.createRow({
                additionalConditions: [
                    {field:‘MMA_Academy_Student_Event_Performer__c’, value:row.Id},
                    {field:‘MMA_Academy_Student_Event_Session__c’, value:SessionModelId},
                    ], doAppend: true
        });{callback: function(result){
        if (result.totalsuccess) {
            alert(‘Performers were added to the selected sessions’);
        } else {

    alert(‘Select a session to add the performers to.’);

I’m glad you got it working!  Cheers!