Results 1 to 2 of 2

Thread: Dynamically rendering form panel in cards layout

  1. #1
    Sencha Premium User
    Join Date
    Feb 2015
    Posts
    27
    Answers
    2

    Default Dynamically rendering form panel in cards layout

    I am working on a modern toolkit app, that makes use of the cards layout to display form panels. I basically have four (4) form panels and have stubbed this all out to allow the user to advance and go back. Form panels 1 through 3 are static per se, and the fourth panel needs to accommodate one of six potentially different forms depending on the object that is selected in form 3.

    This is what i have working so far...

    working-cards.jpg

    My challenge/issue or question is - when a user is on form3 and they choose one of 6 different object types, do i:
    • Option 1 - lay down the generic form4 panel and build it up by appending form fields to the items[] config?
    • Option 2 - choose from 1 - 6 different renderable form panels?


    The following fig. shows option 1- where i "inject" the form elements into an empty generic form panel 4 - i would have to clear/empty it and re-build the items[] config depending on what's selected on form panel 3
    option1.jpg

    The following fig. shows option2 - where i would simply use any one of 6 different form panels that are all built up:

    option2.jpg

    Any suggestions, tips, etc. would be great! Thanks

  2. #2
    Sencha Premium User
    Join Date
    Feb 2015
    Posts
    27
    Answers
    2

    Default

    ok - I have spent some time on this and have come to the conclusion that you DO NOT want to to Option 1 - swapping in/out the form fields into a fourth formPanel object. Rather, it is better to simply add the pre-built formPanel and remove/destroy as needed.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •