You found a bug! We've classified it as EXTJS-9544 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    257
    Vote Rating
    8
    bseddon will become famous soon enough

      0  

    Default Breaking change in TreeStore event handling behavior

    Breaking change in TreeStore event handling behavior


    In versions before 4.2 the root node of a tree store relays events assigned to the store. For example, suppose that I want to intercept nodes being added or removed from a tree store I will add this code:

    this.getMyTreeeStore().on(
    {
    append: this.myAppended,
    remove: this.myRemoved,
    scope: this
    });

    In version before 4.2 these events are relayed through the root node so that the addition of the root itself and of additions and removals from the root will fire the listeners attached to the store. This is no longer true. Events are fired when nodes are added to nodes added to the root but are not fired for the root or nodes added directly to the root.

    Below are outputs from the attached application showing the order in which the 'append' events occur. First using ExtJS 4.1 then using ExtJS 4.2.

    The problem is that the root is appended after all other nodes. The nodes attached directly to the root node appear after all other nodes except the root. This is a marked change.

    It presents a real problem for applications that are trying to sync the same content to more than one tree store. Ideally the tree grids would share the same store but because the NodeInterface becomes part of the node, state information, such as a node's expanded state, is then also shared between tree grids which is not the behavior we want.

    Why has this behavior changed? What is the rationale?

    Output from ExtJS 4.1
    Appending root
    Node /root/a appended to /root

    Node /root/a/a.a appended to /root/a
    Node /root/a/a.b appended to /root/a
    Node /root/a/a.c appended to /root/a
    Node /root/a/a.c/a.c.a appended to /root/a/a.c
    Node /root/a/a.c/a.c.b appended to /root/a/a.c
    Node /root/a/a.d appended to /root/a

    Output ExtJS 4.2
    Node /root//a.a appended to /root/
    Node /root//a.b appended to /root/
    Node /root///a.c.a appended to /root//
    Node /root///a.c.b appended to /root//
    Node /root//a.c appended to /root/
    Node /root//a.d appended to /root/
    Node /root/a appended to /root
    Appending root
    Attached Files

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,800
    Vote Rating
    167
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


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

Thread Participants: 1

Tags for this Thread