Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Dublin, Ireland
    Posts
    4
    Vote Rating
    0
    marcos.td is on a distinguished road

      0  

    Default Answered: Destroy view on deactivate + animateActiveItem on Viewport

    Answered: Destroy view on deactivate + animateActiveItem on Viewport


    Hello,

    I am new with Sencha Touch, so it may be a silly question. I am dynamically creating the views to insert in the Viewport, but I'd like to destroy them when they are not active anymore. They problem is that I am switching views with the function animateActiveItem(), and when I add on the listener "deactivate" to destroy the view, the animation doesnt happen, because the view is destroyed before the animation finish. I tried many things to solve it, but nothing really worked, one of the things I tried was basically this:

    HTML Code:
    Ext.Viewport.animateActiveItem(newView, {
      type: 'slide',
      direction:  'right',
      listeners: {
        animationend: function() {
          var items = Ext.Viewport.getItems().items;
          for (var i in items) {
            if (items[i].isHidden() === true) {
              items[i].destroy();
            }
          }
        }
      }
    });
    It didn't work because it made the app run slower, so sometimes the the app locks up for a second and it causes a bunch of problems. Anyway I think I shouldn't need to do it, there might be a better option. I also tried setting a timeout to destroy the view, but it does not work if the user switches screens too fast.

    Anyone of you guys have an idea of how can I destroy the views after they're deactivated, but keeping the animation?

    Thanks!

  2. What happens when you add an activeitemchange event to the Ext.Viewport?

    Code:
    Ext.Viewport.onAfter('activeitemchange', function() {...});

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,519
    Answers
    3447
    Vote Rating
    814
    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


    What happens when you add an activeitemchange event to the Ext.Viewport?

    Code:
    Ext.Viewport.onAfter('activeitemchange', function() {...});
    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 jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    I've gotten around this issue by using Ext.defer. My animations are set at about 250ms and i defer my destroy call by 300ms to let the animations finish before destroying the page.

  5. #4
    Sencha User rkraus's Avatar
    Join Date
    Dec 2011
    Location
    Bonn / Germany
    Posts
    68
    Vote Rating
    0
    rkraus is an unknown quantity at this point

      0  

    Default


    THX GOD jerome76 !
    You are my hero of the day!!!


    ps: 1976 ist best year ever haha
    Greetings -Ralf Kraus-

  6. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,519
    Answers
    3447
    Vote Rating
    814
    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

      1  

    Default


    Quote Originally Posted by jerome76 View Post
    I've gotten around this issue by using Ext.defer. My animations are set at about 250ms and i defer my destroy call by 300ms to let the animations finish before destroying the page.
    That's not a very solid way to do it though. What if your device slows down and the anims just happen to take 305ms to complete? Might as well listen to the transition end event on the element for that then
    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.

  7. #6
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    That's not a very solid way to do it though. What if your device slows down and the anims just happen to take 305ms to complete? Might as well listen to the transition end event on the element for that then
    Never thought about that. I've really only been working with the iPad so I've never experienced speed issues

  8. #7
    Sencha User rkraus's Avatar
    Join Date
    Dec 2011
    Location
    Bonn / Germany
    Posts
    68
    Vote Rating
    0
    rkraus is an unknown quantity at this point

      0  

    Default


    Is there a transition end event in Sencha ?
    Greetings -Ralf Kraus-

  9. #8
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,519
    Answers
    3447
    Vote Rating
    814
    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


    What you need to do is change the order of things...

    Code:
    cmp.onAfter('deactivate', function() {});
    I usually use this on the container that has card layout on it:

    Code:
    container.onAfter('activeitemchange', function() {});
    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.