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. #21
    Sencha Premium Member
    Join Date
    Sep 2008
    Posts
    710
    Vote Rating
    6
    Bucs is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    No problem! I don't want people to keep making apps that are slow and choppy. Everything I do, I think of the impact it will have on performance and then I find out the best way to do it. I want to see some really cool stuff so I will always help peoplenfine tune things. If that means giving away my secrets, as long as I get some credit it is ok.

    Post back some stuff that you do if you can!

    Mitchell, your post was awesome btw. Your concern with performance is well founded as I know I am guilty of throwing code together just to get the job done under unrealistic mgmt deadlines (are any realistic? . When I first started building Touch apps, I thought that by leaving pages loaded after first use and simply refreshing data on the page if it was called again was going to be "snappier" than a destruction and recreation of the page. Boy was I wrong! Doing so really effects the performance of the app and you can also get caught up in a battle when trying to correctly re-render a page with new data (with things like new image sizes etc)...at least I found it to be a struggle. Once I realize that destroying the page and recreating it added very little overhead to the app, and dramatically simplifies the rendering process..and performance was increased as a result. Anyway, great post and thanks for taking the time to put that together!

    I do have a couple questions though. In the following code, you say that the method will be called when the parent panel is destroyed. How does that happen, I don't see any code to make that happen? Did you mean to call this in the destroyItems() method?

    Code:
    	cleanUpList: function() {
    		//will automatically be called when the parent Panel is destroyed
    		delete this.listStore;
    		delete this.list;
    	},

    Also, what properties do you call 'delete' on, anything you assign as a property to the current (this) component container? I see now that I was not cleaning up properly on component destruction by removing my references, but I guess I'm trying to figure out exactly what I need to cleanup with delete. In reading, you can only delete assigned properties (because they are not marked with DontDelete attribute), so exactly what should I be looking to delete? Why doesn't destroy() clean up these references for us if they are in fact properties of the object being destroyed?

    Lastly, why setup a separate destroyItems() method? Why not just have the deactivate() call this.destroy() then add cleanup code to the OnDestroy event before calling the superclass destroy?

    Thanks again for you post, very informing.

  2. #22
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    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


    in App.Card1.js, I have that function cleanUpList. I set a listener to the List component on line 56 of App.Card1.js to listen to the 'beforedestroy' event. When the Panel destroys, it first executes all it's children's destroy methods so therefor when you destroy the Panel, it will destroy the List which in turn executes the 'beforedestroy' event.

    Any property that you add, you need to handle the clean up.

    For instance, by default the List requires you to set the store property; therefor, the List will automatically clean up that store property. This includes anything in the API Docs under config and public properties (and also any private properties the component creates). So I added this.listStore and this.list to the Panel, which by default isn't a config or public/private property, so I had to write the code to clean that up.
    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.

  3. #23
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    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


    Quote Originally Posted by andreacammarata View Post
    You still have not reply to my post .
    Do you have a solution for my example using your by Index technique?
    If you take a look at my example source, you will see I set references. I also use getComponent(index) to get the buttons because I don't like to add/remove buttons. I feel that App startup can be longer but for sake of usability when the user gets in and starts using it that showing and hiding is a better approach.
    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. #24
    Sencha Premium Member
    Join Date
    Sep 2008
    Posts
    710
    Vote Rating
    6
    Bucs is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Any property that you add, you need to handle the clean up.
    .
    That basically sums it up perfectly, thanks. Lastly, I am getting warnings in the debug console any time I am destroying components. The warning is as follows:

    Code:
    Attempted to remove a component that does not exist. Ext.Container: remove takes an argument of the component to remove. cmp.remove() is incorrect usage. sencha-touch.js:6
    I do not call "cmp.remove()" anywhere in my code...is this a bug in Touch? Using 1.0.2.

  5. #25
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    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


    Quote Originally Posted by Bucs View Post
    Attempted to remove a component that does not exist. Ext.Container: remove takes an argument of the component to remove. cmp.remove() is incorrect usage. sencha-touch.js:6
    I do not call "cmp.remove()" anywhere in my code...is this a bug in Touch? Using 1.0.2.
    In my example code?

    There are two ways to remove a child, you can call the child's destroy method (which is what I like to do, have the child manage itself) or call the parent's remove function with the child as a param.
    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. #26
    Sencha Premium Member
    Join Date
    Sep 2008
    Posts
    710
    Vote Rating
    6
    Bucs is on a distinguished road

      0  

    Default


    Sorry, no...nothing to do with your code. I am seeing this in MY app where I am destroying components upon deactivation. I have no clue where that warning message is coming from...i guess you haven't seen that yet. Trying to figure out if it's something I am doing wrong or if it's a bug in Touch 1.0.2.

  7. #27
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    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


    I haven't seen 1.0.2 yet so I'm not sure.

    What I would do is look at what is going on. You know it's destruction based as, well, it's an error with remove. So I would start seeing where in your function that handles destruction is going on. Two ways:

    1) I put console.log after I execute anything. Then look at the console and see after which console.log the error happens. I know then which line is failing. Example:

    Code:
    destroyItems: function() {
        console.log(1);
        this.someFn();
        console.log(2);
        this.anotherFn();
    }
    If in the console I see:
    1
    2
    some error here
    Then I know that it is the line just after the console.log(2).

    2) This is probably the preferred way. You can set breaks in the console code. To do this, in the Console, click on the Scripts tab. Make sure you are in the correct file by using the "drop down" just above the source code. Then navigate to the function in question and click on the line number. This will add a break. Click again and it will remove. You can also right-click on the line numbers to do actions. This will stop the code execution on those breaks. So instead of console.log every other line, you can now set break points till you find out which line is throwing an error.
    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.

  8. #28
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    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


    Another thing you can do is try a different version of Sencha Touch. I never delete a folder, I always just add a new release to my folder where I keep all the releases just in case I need to test on an earlier version.
    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.

  9. #29
    Sencha Premium Member
    Join Date
    Sep 2008
    Posts
    710
    Vote Rating
    6
    Bucs is on a distinguished road

      0  

    Default


    Yeah, I don't know how you could ever develop these apps without knowing how to use the debugger

    In any event, I have a listener on the panel beging destroyed like so:
    Code:
            beforedeactivate : function (cmp) {  
                //alert('destroy will be called on detail component.');         
                this.destroy(); 
            },
    And then do the following in an onDestroy handler:
    Code:
         onDestroy: function(){
            Ext.each(this.formItems, function(item){
                item.destroy();
            });
            ....ns....superclass.onDestroy.call(this);
        },
    Using break points on this.destroy() and Ext.each....the warning occurs when the code moves from the this.destroy call to the break on Ext.each...before the each is executed. So, either I am not declaring the onDestroy correctly (do I need a function param?) or this is a bug in 1.0.2.

  10. #30
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    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


    Remember, when a component get's destroyed, it will automatically fire each of it's children component's destroy method.

    So I'm thinking the children may already have been destroyed when you (or Sencha Touch) are trying to destroy them.

    Also, I'm not too sure the timing of when "beforedeactivate" and "deactivate" is. Beauty of using "deactivate" (IMHO of course) is that it fires *AFTER* the animation, keeping the animation smooth. However, the downside is that you are building items in the new component and destroying in the old component at the same time. Guess you would just have to play with it to see what you like best.
    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.

Similar Threads

  1. difference between items and docked items
    By thomas12 in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 6 Dec 2010, 7:45 AM
  2. How to hide/show items.
    By TheBigOnion in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 2 Jun 2010, 4:10 AM
  3. dynamically add/remove/show/hide items from toolbar
    By aj3423 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 27 Mar 2010, 4:30 AM
  4. EditorGrid - show/hide items
    By soma13 in forum Ext GWT: Help & Discussion (1.x)
    Replies: 2
    Last Post: 26 Mar 2009, 4:39 AM

Thread Participants: 9

Tags for this Thread