I like to add a javascript snippet in skuid to display message if no row selected in the table

  • 1
  • Problem
  • Updated 1 year ago
  • Solved
Photo of Matrix

Matrix

  • 590 Points 500 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Christine Jessen

Christine Jessen

  • 670 Points 500 badge 2x thumb
Hi!

You can use a snippet similar to this to check if there are selected items on the table.  Make sure to update the table Unique ID and reference it in the snippet:
// Change MainTable to the name of your table
var table = skuid.$('#MainTable').data('object');
var list = table.list;
var selectedItems = list.getSelectedItems();
if (selectedItems.length === 0) {
    // Take action here to show your error message
    alert('No Items Selected!');
}
Hope this works for you!  
Thanks,
Christine
Photo of Matrix

Matrix

  • 590 Points 500 badge 2x thumb
Thanks Christine