Skip to main content
Nintex Community Menu Bar
Question

how to change row-action icon once the user select a row/clicks on a row in skuid table

  • July 10, 2024
  • 4 replies
  • 19 views

Forum|alt.badge.img+6

Hi

I need to change the icon for a row-action once the user clicks on row/row action icon in table.
I am trying through a row action snippet, not knowing how to get it done.

I gave the icon “fa-square-o”.

Every time the user selects a row, change icon to “
fa-check-square-o”  and if other row is selected change icon back on to “fa-square-o” 

Below is my snippet I tried:

var params = arguments[0],
$ = skuid.$;

//console.log(‘FROM the row action for SELECTION - params are BELOW’);
//console.log(params);

var model = params.model;
var item = params.item;     //console.log(‘item ==========’); console.log(item);
var list = item.list;       //console.log(‘item list =====’); console.log(list);

 /****   REMOVE the hightlight for rest of rows;  
 
 
WHILE removing highlight for row already selected , CLEAR the TEMP model and 
 * in the END after hightlighting current row , push the selected row into MODEL 
 *
 
****************************************/
    $.each(list.renderedItems, function()      
            { 
                this.element.removeClass(‘highlighted-row’);
                //this.element.removeClass(‘fa-check-square-o’);
            });

 /
 Highlight the current-ROW   ********/    
    item.element.addClass(‘highlighted-row’);


This topic has been closed for replies.

4 replies

Forum|alt.badge.img+3
  • July 10, 2024

Try this:

var element = arguments[0].button[0], $ = skuid.$; if($(element).hasClass(‘fa-square-o’)){ $(‘.fa-check-square-o’).removeClass(‘fa-check-square-o’).addClass(‘fa-square-o’); $(element).removeClass(‘fa-square-o’).addClass(‘fa-check-square-o’); }else if($(element).hasClass(‘fa-check-square-o’)){ $(element).removeClass(‘fa-check-square-o’).addClass(‘fa-square-o’); }


Forum|alt.badge.img+17
  • Nintex Employee
  • July 10, 2024

Another alternative is to use an action framework sequence on that row action you have already defined.  It should update a UI Only field on the model to be “true”   Then your row action icons can use conditional rendering to display based on whether the UI Only field is true or false. 

Declarative.  Sweet! 


Forum|alt.badge.img+6
  • Author
  • July 10, 2024

Thank you so much.
This works perfectly!


Forum|alt.badge.img+6
  • Author
  • July 10, 2024

Thanks Rob! I will try this too.