Is there a JS option to select all rows in a table?

  • 1
  • Question
  • Updated 4 years ago
I know this can be done with the 'Mass Actions' option, but I'd prefer to do it with a script if possible...
Photo of Scott


  • 2,732 Points 2k badge 2x thumb

Posted 5 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 53,784 Points 50k badge 2x thumb
If you only have one Table on your page, this will select all currently-visible items:

skuid.$('.nx-skootable-data > thead > tr > th > input[type="checkbox"]').click();

If you want to select rows in a particular Table, then you'll need to give that Table a Unique Id, e.g. "AccountsTable" (through the Table's Advanced properties) and then use something like this:

skuid.$('#ProductsTable .nx-skootable-data > thead > tr > th > input[type="checkbox"]').click();
Photo of Tami Lust

Tami Lust

  • 5,456 Points 5k badge 2x thumb
Zach I tried the code to select the rows in a particular table and nothing happend.

I have an in-line snippet with "skuid.$('#BundleLineTable .nx-skootable-data > thead > tr > th > input[type="checkbox"]').click();

I have given my table the same unique id: BundleLineTable

Can you see where I am messing up?
Photo of Scott


  • 2,732 Points 2k badge 2x thumb
Much obliged Zach!