1. #1
    Sencha User chris_nl's Avatar
    Join Date
    Nov 2011
    Location
    Amstedam
    Posts
    34
    Answers
    1
    Vote Rating
    0
    chris_nl is on a distinguished road

      0  

    Question Answered: Performance question about adding pages to the viewport.

    Answered: Performance question about adding pages to the viewport.


    Hello,

    Is it good practice to keep using viewport.add( ..) when you want for example to slide to the next card?
    Does your app not become slow, and do you have to remove them manually when they are slided out the screen?

    Or is it better to use a structure of items: [ pagex, pagey, pagez] and just move between these pages so there
    are no extra pages added on the viewport and so you don't have to keep track of what page is added to the viewport and what page has to be removed?

    I noticed the { after:function() { }{ method does not work when you want to fire a something when a slide transition has completed. Is there an alternative for that?

    Thanks in advance,

    Regards, Chris.

  2. So this seems to be your application structure. Using card layout, which Ext.Viewport does, when an item is not currently the active item, everything is still rendered and take up memory. This is up to the developer to keep lightweight. If you keep adding items to a card layout, your app will become slower and slower the more you have rendered.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3461
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So this seems to be your application structure. Using card layout, which Ext.Viewport does, when an item is not currently the active item, everything is still rendered and take up memory. This is up to the developer to keep lightweight. If you keep adding items to a card layout, your app will become slower and slower the more you have rendered.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User chris_nl's Avatar
    Join Date
    Nov 2011
    Location
    Amstedam
    Posts
    34
    Answers
    1
    Vote Rating
    0
    chris_nl is on a distinguished road

      0  

    Default


    Thanks! I keep that in mind when creating the card layout structure!
    But do u know if there is an event that listens when a card slide is completed in version sencha-touch2p3 ?

    Thanks,
    Chris.

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3461
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    it seems to me that the activate and activeitemchange happens before animation. I'm hoping this changes but the animation duration is known so you could delay the event listener.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha User chris_nl's Avatar
    Join Date
    Nov 2011
    Location
    Amstedam
    Posts
    34
    Answers
    1
    Vote Rating
    0
    chris_nl is on a distinguished road

      0  

    Default


    Thanks! I could use a setTimeout delay on removing the card from the viewport as the duration of the slide is 500 miliseconds.

Thread Participants: 1