How to build nested decks in Skuid Mobile Composer

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I am trying to display an object using a deck, then have the attachments of the records of those object being displayed in another deck nested in the first deck.

I manage to set the attachment model's parent id to match the first object model's id. However when displaying, it only matches to the first row of the first object model.

What's the best way of displaying a nested deck within another deck and how would you relate the models together to display correctly?
Photo of Jsun Pe

Jsun Pe

  • 230 Points 100 badge 2x thumb

Posted 4 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I don't think this is possible in the mobile page builder. You need to set the Context of the component which is not available in the mobile page builder.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Jsun,

Not sure if this is worth the effort, but you could potentially create a type of 'drawer' for the attachments.

You'll want to make sure you set you Attachments Model to not pull any data on page load. Make the condition you set up to link to the parent id filterable.
Add two buttons in the first division of your deck on the records deck. One to open your 'drawer,' and one to close it. (you can render these based on whether there is data in the attachments model, if you only want you users to see one at a time).

When the user clicks Open button, (1) Set the value of the condition on your attachments model to {{Id}}, and (2) Query the Attachments Model.

When the user clicks the Close button, Empty the attachments model.

I think that should work?
Photo of Jsun Pe

Jsun Pe

  • 230 Points 100 badge 2x thumb
Thanks guys, I actually did another approach - I tried to replicate this http://help.skuidify.com/m/models-conditions-filters/l/102520-include-child-relationships and hacked the xml in the mobile page to work in a similar way, and it worked.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Nice! Glad you got it working.