Make table default to toggled off

  • 2
  • Question
  • Updated 1 week ago
  • Answered
Hello All,

I have a table and a toggle button that shows/hides the table. Perfect, but I would like for the page to load with the table default to toggled off (hidden). Is there a way to accomplish this?
Photo of Michael Schniepp

Michael Schniepp

  • 1,908 Points 1k badge 2x thumb
  • hopeful

Posted 2 years ago

  • 2
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 18,336 Points 10k badge 2x thumb
You can create a UI only field that is blank or “hide” by default, then have a button that sets it to “show”. Then render the table based on that UI only field.
Photo of Michael Schniepp

Michael Schniepp

  • 1,908 Points 1k badge 2x thumb
Thanks I think this is the best approach for me. 
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,612 Points 10k badge 2x thumb
Michael,

If you are using Skuid 11, you can setup an Action Sequence.  Set it up as 'Event-triggered sequence' and set Event Name as 'Skuid Page: Rendered'.  Then add an action to Toggle your table and Hide it.  You can also do other actions when the page is rendered.

Thanks,

Bill
Photo of Michael Schniepp

Michael Schniepp

  • 1,908 Points 1k badge 2x thumb
Thanks Bill, We are not using skuid 11 yet. 
Photo of Elissa Bradley

Elissa Bradley

  • 2,038 Points 2k badge 2x thumb
Bill, we've tried this - we have added an action sequence to the "Select Actions" of a Search Component.  It doesn't seem to work in that context.  (We've used the "toggle/hide" action elsewhere, but it doesn't work on the Search Component.)  Anyone else run into this?
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,612 Points 10k badge 2x thumb
Elissa,

What version of Skuid are you using?  What you described is working for me using Skuid on Salesforce (Version 12.2.10).  Here is my XML.

Thanks,

Bill

<skuidpage unsavedchangeswarning="no" personalizationmode="server" showsidebar="true" showheader="true" theme="Material Blue">
<models/>
<components>
<grid uniqueid="sk-38VR-329" columngutter="4px">
<divisions>
<division behavior="flex" minwidth="100px" ratio="1" verticalalign="top">
<components>
<search uniqueid="sk-38Vk-444" soslfields="Name Fields">
<resultactions/>
<selectactions>
<action type="action-sequence" action-sequence-id="5a7c1805-6cfb-4d17-b23c-38bce6843351"/>
</selectactions>
<objects>
<object datasource="salesforce" id="Contact" icon="sk-icon-contact" headername="Contacts" fields="Email" orderby="Name" returnlimit="10">
<fields>
<field id="Name"/>
<field id="Email"/>
</fields>
</object>
</objects>
</search>
</components>
</division>
<division behavior="flex" verticalalign="top" minwidth="100px" ratio="1">
<components>
<richtext multiple="false" uniqueid="sk-38VQ-317">
<contents>&lt;p&gt;Please hide me when you find a contact and select it&lt;/p&gt;
</contents>
</richtext>
</components>
</division>
</divisions>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</grid>
</components>
<resources>
<labels/>
<javascript/>
<css/>
<actionsequences>
<actionsequence id="5a7c1805-6cfb-4d17-b23c-38bce6843351" label="Hide" type="reusable">
<description/>
<actions>
<action type="toggleRenderComponent" behavior="hide" componentid="sk-38VQ-317"/>
</actions>
</actionsequence>
</actionsequences>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

Photo of Elissa Bradley

Elissa Bradley

  • 2,038 Points 2k badge 2x thumb
Just upgraded to 12.2.10.  My XML looks just like yours - so I'm assuming there's something else going on with my page.  (The Select Actions on my search have 6 other actions.)  I'll try simplifying and see if I can narrow down why this won't work.  Thanks for taking a look at this for me.  
Photo of Michael Schniepp

Michael Schniepp

  • 1,908 Points 1k badge 2x thumb
I found a not-so-elegant solution that still seems to work fine for me:
The table only renders for me on page load (using running user attribute conditions based on my name) and not for our users. But when users click the toggle button the table will appear. This has been successful in my testing.
(Edited)
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 18,336 Points 10k badge 2x thumb
Just a thought:
I use a pick list UI only field and set it’s value to render or hide a variety of elements on the page by setting the picklist value with a button. You can create your own “tab sets” with this functionality giving you more flexibility. You can also use it to build a contextual set of components depending on the activity a person wants to do or see.