1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    68
    Answers
    1
    Vote Rating
    2
    MaciejZabielski is on a distinguished road

      0  

    Default Unanswered: Application with several Viewports?

    Unanswered: 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
    8,999
    Answers
    666
    Vote Rating
    456
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      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,593
    Answers
    541
    Vote Rating
    324
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      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
    68
    Answers
    1
    Vote Rating
    2
    MaciejZabielski is on a distinguished road

      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).

Thread Participants: 2

Tags for this Thread