Results 1 to 4 of 4

Thread: 'index' not updated on siblings when adding nodes to NodeInterface Model in TreeStore

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1

    Default 'index' not updated on siblings when adding nodes to NodeInterface Model in TreeStore

    Using Ext JS 4.0.7

    It seems that when a node is added to or removed from a parent node (implementing Ext.data.NodeInterface) in a TreeStore, the siblings of the new child node do not have their 'index' fields updated accordingly. For example, consider a parent node with three children, A, B and C with indexes 0, 1 and 2 respectively. If a new node is inserted between the nodes A and B you would expect (due to the documentation of the 'index' field in Ext.data.NodeInterface) the indexes of B and C to be incremented by 1, but they're not.

    This is related to http://www.sencha.com/forum/showthre...drop-operation

    A simple fix would be to modify the Ext.data.NodeInterface.updateInfo function to update the indexes of all siblings after the inserted or removed node (an example for the insertion case is provided in the above mentioned thread).

    Of course this assumes that the TreeStore has its nodes sorted by the 'index' field, which the 'index' field documentation would seem to imply but which in fact does not seem to be the default sort for a TreeStore...

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449

    Default

    Have you checked this against 4.1.0 beta 1?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3

    Default

    I will actually be giving 4.1 beta 1 a go as of today as I need some new functionality it provides (callback functions for Ext.data.AbstractStore.sync() (and hopefully it will address many of the bugs I've had to create overrides and other workarounds for)). Will post back with results.

  4. #4

    Default

    Looks like it's fixed in 4.1 beta 1.

Posting Permissions

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