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
    Sep 2012
    Posts
    2
    Vote Rating
    0
    yallups is on a distinguished road

      0  

    Default Unanswered: Ext.each returns half complete records and half "undefined"

    Unanswered: Ext.each returns half complete records and half "undefined"


    I have used Ext.each(array, function(curr, index){...doSomething...}); to perform an action using each element in that array but what I have noticed in some cases is that it will return half of the items complete and half "undefined". I have done some work arounds to make it ok but now I am running into and issue that I can't seem to fix and maybe someone out there has an explanation/solution.

    I am using a tree that has a folder full of records that I want to iterate over and throw them into another folder or leave them where they are based on their name.

    Code:
    folder.eachChild(function(curr){
        if(Ext.Array.contains(parents, curr.get('name')){
            otherFolder.appendChild(curr);
        }
    });
    if you do a console.log on curr before the if statement and comment out the if statement then you will see half of the records complete and half "undefined".

    Extjs 4.1 using firefox 13.0.1

    This is my first post so let me know if I should fix something or provide more info. Thanks

  2. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    Your problem is that folder.childNodes will be shrinked each time you move one of its child node to other folder. Below is one of solution to fix this problem.
    Code:
    var needToMove = [];
    folder.eachChild(function(curr){
        if(Ext.Array.contains(parents, curr.get('name')){
            //otherFolder.appendChild(curr);
            needToMove.push(curr);
        }
    });
    for(var i = 0, len = needToMove.length; i < len; i++){
        otherFolder.appendChild(needToMove[i]);
    }

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    2
    Vote Rating
    0
    yallups is on a distinguished road

      0  

    Default


    AHHH! Why didn't I think of that. So obvious. Thank you for responding so quickly.

Thread Participants: 1

Tags for this Thread