Custom Mass Update Selected Rows popup

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Is there a way to configure a popup with a similar UI to the standard Skuid mass update dialog?  I suppose I could use Page Title with custom buttons for Apply and Cancel.  




Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb

Posted 4 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
The popup layout is easy.

It's the application of the Mass Update based on what you've entered into popup that would be difficult.

Here's how I would do it. 
  1. Add a model of the same type as in the table to store the updates called "updateValues" or something.
  2. Create a Mass Update action of Multiple Actions type
  3. Cancel the model "updateValues"
  4. Create a row in "updateValues"
  5. Show a popup with  a field editor in edit mode for "updateValues"
  6. Configure the field editor the way you'd like.
  7. Add a Page Title in the popup to add Buttons.
  8. The primary button would be something to apply the updates. This would almost certainly have to be a js snippet to apply the changes to the selected rows. You'd loop through the "Changes" in the "updateValues" model and then loop through the selected rows applying those changes.
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Yup.


Photo of Jonathan Adlerstein

Jonathan Adlerstein

  • 528 Points 500 badge 2x thumb
What's the syntax to access the selected rows in the table once you're in a different snippet (and therefore don't get the arguments passed in)?