How do I select Field Editors from a specific Tab?

  • 1
  • Question
  • Updated 9 months ago
  • Answered
I'd like to know if there is a way to select all field editors inside a tab that has been selected by the user.
Photo of Darren

Darren

  • 90 Points 75 badge 2x thumb

Posted 9 months ago

  • 1
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Can you be more specific in what you're requesting? What do you mean by selecting? What are you wanting to accomplish by selecting? Pictures are extraordinarily helpful.
Photo of Darren

Darren

  • 90 Points 75 badge 2x thumb
For the sake of client confidentiality I can't post pictures.

As to be more precise I have a SKUID page with numerous Tabs.
Each Tab holds multiple Field Editors, where each Field Editor may have different Models.
Now by selected I mean click, so when a User clicks a specific Tab and sees its content, a JS would check if the User has the appropriate Profile and if they don't have all the Field Editors rendered read-only.
Not all Tabs have this requirement and all Field Editors in all tabs have read as the default mode.
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Have you thought about using this declaratively with conditional rendering in Skuid? Is there functionality you're wanting with the JS that can't be provided with declarative means alone?
Photo of Darren

Darren

  • 90 Points 75 badge 2x thumb
I have done it declarative. I created clone of tabs with the field editors having a different mode. Then have conditional render give the expected output.

This method does the job, but it's very messy especially for an ever-growing SKUID page. I'd rather have the functionality be in a JS so that those that follow after me and work with me don't to do the same changes twice for one tab - on again a page with multiple tabs.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Two other ideas: 
1. Skuid will respect the profile information about all fields.  So you might have an acceptable solution without doing anything.  (What I don't know is whether someone with R/O access to a field would be prevented from putting the field in edit mode - of they'd get an error on save...)

2. You can keep things in a single tab - by using conditional enablement on a field by field basis.  ONly enable fields that correspond to the right profiles.