close drawers v2

Hope everybody is well. 

Has anybody played with closing drawers in v2 when opening new ones (or any of the similar situations that have arisen previously in v1)? Obviously with v2 the way the tables are constructed completely differently, the old approaches won’t work. (Though it has been fun messing around with the skuid.debug to see if they can be replicated). Like cards on decks the drawers ID’s are used in duplication so obvious hackish options are not readily available. 

Thanks,
AP

Hi Arne-Per, thanks for asking about this. I’m checking with the team to see if there’s an existing API for this.

It seems like ideally this would be handled as a table component action in the Action Framework, and I’ve added this idea to our internal tracking system so that the product team is aware of this.

Thanks for helping to make Skuid better!

Hi Anna, any luck finding a current solution? Thanks

Hi Arne-Per, I don’t believe there is a way to do this currently with the v2 Javascript API.  I’ll let you know if I get any new information. 

How important is this issue to you? (e.g. nice to have, important, keeping you from buliding in V2, etc.).

I’ve added this as a product idea and knowing the importance will help it get categorized and prioritized appropriately.

It will keep me from building a handful of pages in v2 which otherwise was jamming but you have seen the challenges in v1 that are avoided by having the functionality.
Thanks for the consideration. Stay safe and well!

This shouldn’t be much different than in V1. Can you provide XML for a standard object for me to look at?

Of course. I will throw together a page shortly. 
However, v2 does build the tables and drawers with very different gridding than v1.
Thanks for taking a peek.

<skuid__page unsavedchangeswarning=“yes” personalizationmode=“server” showsidebar=“true” showheader=“true”> <skuid__table allowColumnFreezing=“dragDrop” model=“account” uniqueid=“sk-1J5s-3193” mode=“read” pageSize=“10” enableDrawers=“true”> <skuid__table allowColumnFreezing=“dragDrop” model=“contact” uniqueid=“drawerTable” mode=“read” pageSize=“10”> </skuid__table> </skuid__table> </skuid__page>

<skuid__page unsavedchangeswarning=“yes” personalizationmode=“server” showsidebar=“true” showheader=“true”>























<skuid__table allowColumnFreezing=“dragDrop” model=“account” uniqueid=“sk-1J5s-3193” mode=“read” pageSize=“10” enableDrawers=“true”>









<skuid__table allowColumnFreezing=“dragDrop” model=“contact” uniqueid=“drawerTable” mode=“read” pageSize=“10”>











</skuid__table>






</skuid__table>










</skuid__page>

that didn’t post as expected. 

I don’t see an obvious application of :https://community.skuid.com/skuid/topics/close-all-drawers-action 

and as I mentioned with deck, id’s are reused.

#drawerTable is used for ease of tracking. Interestingly each drawer seems to have its own instance of the contact model.

Thanks again for taking a look.

<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true"> <models> <model id="account" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account"> <fields> <field id="Name"/> <field id="BillingPostalCode"/> </fields> <conditions/> <actions/> </model> <model id="contact" limit="" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Contact"> <fields> <field id="AccountId"/> <field id="Account&#46;Name"/> <field id="Name"/> <field id="Title"/> </fields> <conditions> <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Account&#46;Id" clientorserver="server" state="filterableoff" inactive="true" name="Account&#46;Id"/> </conditions> <actions/> </model> </models> <components> <skuid__table allowColumnFreezing="dragDrop" model="account" uniqueid="sk-1J5s-3193" mode="read" pageSize="10" enableDrawers="true"> <fields> <field id="Name" uniqueid="fi-1J7C-12416"/> <field id="BillingPostalCode" uniqueid="fi-1J7C-12417"/> </fields> <filtering enableSearch="false"/> <rowActions/> <massActions/> <drawer> <components> <skuid__table allowColumnFreezing="dragDrop" model="contact" uniqueid="drawerTable" mode="read" pageSize="10"> <fields> <field id="Name" uniqueid="fi-1J6W-8159"/> <field id="Title" uniqueid="fi-1J6W-8160"/> <field id="AccountId" uniqueid="fi-1J75-11240"/> </fields> <filtering enableSearch="false"/> <rowActions/> <massActions/> <conditions> <condition type="contextrow" field="Account&#46;Id" mergefield="Id" operator="=" fieldtargetobjects="Account"/> </conditions> </skuid__table> </components> <beforeLoad> <action type="setCondition" model="contact" valuesource="fieldvalue" condition="Account&#46;Id" value="{{Account&#46;Id}}"/> <action type="requeryModel" model="contact" behavior="standard"/> </beforeLoad> </drawer> <actions> <action type="multi" label="Run actions"> <tooltip position="top"/> <actions> <action type="custom" snippet="newSnippet"/> </actions> </action> </actions> </skuid__table> </components> <resources> <labels/> <javascript> <jsitem location="inlinesnippet" name="newSnippet" cachelocation="false">var params = arguments[0], $ = skuid&#46;$; $&#46;each($('&#46;c_2101_2150'), function(){ this&#46;click(); });</jsitem> </javascript> <css/> <actionsequences/> </resources> <styles> <styleitem type="background" bgtype="none"/> </styles> </skuid__page> 

Thanks Pat. I see what you did there. It is very cool. I guess I could query existing buttons check their state and close if needed with this. Your page runs into same things I did. Which it reverses all the drawers. (Actually it runs into a remoting issue).

It refreshes my efforts! Thanks!