Results 1 to 10 of 10

Thread: Tree Error in ExtJS 4.2-beta

    Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    9
    Vote Rating
    4
      1  

    Default Tree Error in ExtJS 4.2-beta

    Code:
    Ext.widget("window", {    autoShow: true,
        width: 320,
        height: 120,
        layout: "fit",
        items: [{
            xtype: "treepanel",
            rootVisible: false,
            store: Ext.create("Ext.data.TreeStore", {
                root: {
                    children: [{
                        "checked": false,
                        "text": "1",
                        "expanded": true,
                        "children": [{
                            "text": "1.1",
                            "expanded": true,
                            "children": [{
                                "text": "1.1.1"
                            }, {
                                "text": "1.1.2"
                            }, {
                                "text": "1.1.3"
                            }]
                        }, {
                            "text": "1.2",
                            "expanded": true,
                            "children": [{
                                "text": "1.2.1"
                            }, {
                                "text": "1.2.2"
                            }, {
                                "text": "1.2.3"
                            }]
                        }]
                    }, {
                        "text": "2",
                        "children": [{
                            "text": "2.1",
                            "children": [{
                                "text": "2.1.1"
                            }, {
                                "text": "2.1.2"
                            }, {
                                "text": "2.1.3"
                            }]
                        }]
                    }],
                    expanded: true
                }
            }),
            listeners: {
                checkchange: function (node, checked) {
                    var i;
                    node.removeAll();
                }
            }
        }]
    });
    When check first node - disappear second node too in chome and firefox.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,644
    Vote Rating
    62
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,644
    Vote Rating
    62
      0  

    Default

    Is this not just your checkchange listener removing all child nodes from any node which has its checked status changed?
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  4. #4
    Sencha User
    Join Date
    Mar 2013
    Posts
    9
    Vote Rating
    4
      0  

    Default

    chrome debugger enter in this handler for only one time. If I'll sort store - disappeared nodes showed up.
    And on 4.1.1 this code works flawless

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,644
    Vote Rating
    62
      0  

    Default

    I can't understand you.

    You have a checked handler which removes the nodes. So that's why they disappear.

    What is this new information about sorting?
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  6. #6
    Sencha User
    Join Date
    Mar 2013
    Posts
    9
    Vote Rating
    4
      0  

    Default

    if I call tree.getStore().sort("text") /* or any other column */ in some cases it show disappeared nodes. But anyway it don't works fine - some nodes can doubles, on again sort trying it throw exception... I can't found workaround for some hours :-(

  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,644
    Vote Rating
    62
      0  

    Default

    I think this is a bug which is fixed, but the code is unreleased.

    It works here, so in the GA, I think you will be fine.
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  8. #8
    Sencha User
    Join Date
    Mar 2013
    Posts
    9
    Vote Rating
    4
      0  

    Default

    thx a lot. ?an you make me happy told when it will come about? :-)

  9. #9
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,644
    Vote Rating
    62
      0  

    Default

    Very soon!
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  10. #10
    Sencha User
    Join Date
    Mar 2013
    Posts
    9
    Vote Rating
    4
      0  

    Default

    same error in ExtJS 4.2.0-gpl:

    Code:
    Ext.widget("window", {
      autoShow: true,
      width: 320,
      height: 240,
      layout: "fit",
      items: [{
        xtype: "treepanel",
        rootVisible: false,
        store: Ext.create("Ext.data.TreeStore", {
          root: {
            children: [{
              "checked": false,
              "text": "1",
              "expanded": true,
              "children": [{
                "text": "1.1",
                "expanded": true,
                "children": [{
                  "text": "1.1.1"
                }, {
                  "text": "1.1.2"
                }, {
                  "text": "1.1.3"
                }]
              }, {
                "text": "1.2",
                "expanded": true,
                "children": [{
                  "text": "1.2.1"
                }, {
                  "text": "1.2.2"
                }, {
                  "text": "1.2.3"
                }]
              }]
            }, {
              "text": "2",
              "children": [{
                "text": "2.1",
                "children": [{
                  "text": "2.1.1"
                }, {
                  "text": "2.1.2"
                }, {
                  "text": "2.1.3"
                }]
              }]
            }],
            expanded: true
          }
        }),
        listeners: {
          checkchange: function (node, checked) {
            node.removeAll();
            node.appendChild({
              text: 1,
              expanded: true,
              children: [{
                text: 2,
                expanded: true,
                children: [{
                  text: 3, //<- it will be hidden
                  expanded: true,
                  children: []
                }]
              }]
            });
          }
        }
      }]
    });
    Can be looked at jsfiddle: 8L2TA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •