Change default mode of a popup

  • 1
  • Question
  • Updated 2 years ago
I have created a page that I would like to use for creating records in a table via a Global Action via a popup.  I would like to use the same  page for viewing details of a table row.  When using the popup for creating I would like the fields to show as editable but not when used for viewing details.

I am new Skuid user so hopefully there is a simple answer.

Thanks
Photo of Scotty

Scotty

  • 282 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Probably the simplest way is to copy & paste the XML for your global action "creating" popup into a new row action "viewing" popup, and then change the mode for the field editors in the new one.

You have to maintain two versions of basically the same thing that way...
At least until the next release? (**looks hopefully toward the Skuid**)

Otherwise, you could change the modes of the field editors with with javascript based on whether the record was new.

Can anyone think of another way?

If there's a way to pass a parameter to a page include that would somehow change the mode, that would be handy too, but I haven't seen anything like that done.
Photo of Paulo Correia

Paulo Correia

  • 264 Points 250 badge 2x thumb
I am looking for this Javascript option. Could you provide a simple example to get us started?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Scotty - are you trying to use a single page include for both situations?  That makes lots of sense. 

I would reccomend what Matt says above.  Write an inline JS snippet that changes the mode of the field editor based on whether there is data or not.  Existing data = read/edit mode.  No date = edit. 

I don't think anything in the upcoming release will make this easier.  Sorry....