"Remove context row(s) from Model" want to do to the opposite

  • 1
  • Question
  • Updated 3 years ago
I am using the actions framework on a table with global actions.

For the global action, I'd like to select a few rows with the checkbox, and have all of the other rows removed from the model. I have used the "Remove context row(s) from Model" action, and it does the opposite of what I am after.

Any way to have an action where it is essentially, "Remove all rows, except context row(s), from Model"?
Photo of Sean


  • 630 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,986 Points 20k badge 2x thumb
This wouldn't be hard with a little javascript. Create an Id= multiple values condition on your model. Then, have your action run javascript that:
  • gets the Ids of the selected rows, 
  • creates a semicolon-separated string of them, 
  • activates and set's the value of your condition to that string, and 
  • query's the model 

(you could use the action framework for the query step if that's more comfortable for you).

This will help you get the selected rows: