Results 1 to 4 of 4

Thread: Application with several Viewports?

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    69
    Answers
    1
    Vote Rating
    2
      0  

    Default Application with several Viewports?

    Hi,

    I'm trying to find a best way to structure an application that has several main views: main application view, administration view, configuration view. Right now I have only main - actually a Viewport with border layout. I think that I can "throw away" previous view when switching to next one, as this is rarely done, and I don't need to come back to previously rendered view.

    My first idea was to create separate Viewports, and create them when needed. Now I get an impression, that I should have only one "master" viewport for application and switch between panels?
    I would like to avoid even deeper nesting of components like Viewport - CardLayout (panels) - content.

    What is the best way of switching between viewports or is this not recommended at all?
    Can someone suggest what would be the best way of handling that?
    Thank you!

    Best regards,
    Mike

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,390
    Answers
    716
    Vote Rating
    498
      0  

    Default

    Do any of our online examples emulate the behavior you are looking for?

    You should only have 1 viewport per application.

    Scott.

  3. #3
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,790
    Answers
    583
    Vote Rating
    391
      0  

    Default

    You can destroy a viewport and manually create a new one. I've done it on occasions where I didn't have full control over what I was being fed. Generally you'd be better off just removing all the children of the viewport and replacing them with new children.

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Posts
    69
    Answers
    1
    Vote Rating
    2
      0  

    Default

    Hi, thanks for your input! I have created a layout that is organized this way now:
    MasterViewport (card layout) consists of:
    -- collection of main views / panels like master app, administration, etc (each with border layout) consists of:
    -- -- panels, grids, tree views etc

    It works fine for now, I was only worried of adding another nesting level of viewport + extra panel.
    In worst case I have Viewport -> panel -> panel -> tab panel -> grid panel nesting.
    Whats more, in 90% of time users will only use main panel (main card).

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
  •