close drawers v2

Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
edited June 25, 2020 in Questions
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

Comments

  • Anna WiersemaAnna Wiersema 🛠️ 
    edited June 25, 2020
    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!
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 18, 2020
    Hi Anna, any luck finding a current solution? Thanks
  • Anna WiersemaAnna Wiersema 🛠️ 
    edited May 26, 2020
    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.
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 27, 2020
    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!

  • Pat VachonPat Vachon 💎💎💎
    edited May 27, 2020
    This shouldn't be much different than in V1. Can you provide XML for a standard object for me to look at?
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 26, 2020
    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.
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 26, 2020
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 26, 2020
    <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.Name"/>
    <field id="Name"/>
    <field id="Title"/>
    </fields>
    <conditions>
    <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Account.Id" clientorserver="server" state="filterableoff" inactive="true" name="Account.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.Id" mergefield="Id" operator="=" fieldtargetobjects="Account"/>
    </conditions>
    </skuid__table>
    </components>
    <beforeLoad>
    <action type="setCondition" model="contact" valuesource="fieldvalue" condition="Account.Id" value="{{Account.Id}}"/>
    <action type="requeryModel" model="contact" behavior="standard"/>
    </beforeLoad>
    </drawer>
    </skuid__table>
    </components>
    <resources>
    <labels/>
    <javascript/>
    <css/>
    <actionsequences/>
    </resources>
    <styles>
    <styleitem type="background" bgtype="none"/>
    </styles>
    </skuid__page>

  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 26, 2020
    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.
  • Pat VachonPat Vachon 💎💎💎
    edited June 3, 2020
    <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.Name"/> <field id="Name"/> <field id="Title"/> </fields> <conditions> <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Account.Id" clientorserver="server" state="filterableoff" inactive="true" name="Account.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.Id" mergefield="Id" operator="=" fieldtargetobjects="Account"/> </conditions> </skuid__table> </components> <beforeLoad> <action type="setCondition" model="contact" valuesource="fieldvalue" condition="Account.Id" value="{{Account.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.$;   $.each($('.c_2101_2150'), function(){     this.click(); });</jsitem> </javascript> <css/> <actionsequences/> </resources> <styles> <styleitem type="background" bgtype="none"/> </styles> </skuid__page> 
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited June 3, 2020
    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! 
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!