Results 1 to 6 of 6

Thread: TreeStore.update() not updating nodes in TreePanel

  1. #1

    Exclamation TreeStore.update() not updating nodes in TreePanel

    After updating a tree item on the tree store using TreeStore.update(), calling TreePanelSelectionModel.getSelectedItem() results in a stale item being returned.

    I'm making a call to update an item on a tree store as follows:
    BeanModel itemModel = beanModelFactory.createModel(item);
    The new tree item appears correctly in the tree based on the icon, as set in a custom iconSelector. That is, the items being passed to the icon selector include the updated item. Checking the actual TreeStore pointed to by both the TreePanel and the selection model shows that the updated item is indeed present in the tree store. The stale item does not exist in the store after the update.

    I'm getting the currently selected item as follows:
    TreePanelSelectionModel<BeanModel> selModel = tree.getSelectionModel();
    BeanModel model = selModel.getSelectedItem();
    The model item is the pre-updated item (again, an item that does not exist in TreeStore, post update). However, Looking at the node list in the TreePanel itself shows the stale item is still in the node list. My understanding is that the update call on the tree store fires the Update event. Shouldn't this event result in updating the nodes in the tree?

    How can I force the tree to see the update to the treestore? I need to have the selected item reflect the current item in the TreeStore, not a stale item held in the TreePanel.


  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007


    There are some known limitations with update.

    What are you doing exaclty? Why do you create a new BeanModel instance?

  3. #3


    The change to the item is a status flag. This flag results in a new icon for the item in the tree and a different behavior of the context menu when that item is selected. I didn't want to reload the entire tree for a change to only a single item.

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007


    I dont understand why your selectionmodel still returns the old model with the old flag.

    Can you try to reproduce your code in a small standalone testcase that implements EntyrPoint?

  5. #5


    Ok, I'll try, but it'll be some time before I can get to it. I'm just reloading the entire tree for the time being.

  6. #6
    Sencha Premium Member
    Join Date
    Feb 2015


    any update on this problem? I am attempting to update the store on a tree and the update does not seem to be working.

    Here's a code snippet:
    Node newNode = getUpdatedData();
    Node oldNode = objTree.getStore().findModel("key", node.getKey());
    if (oldNode != null) {

    The tree is not updated. Any ideas? What is meant by sven's comment that "update has it's limitations"?

Similar Threads

  1. TreeStore updates not working for child nodes
    By emilio.vivaz in forum Sencha GXT Q&A
    Replies: 5
    Last Post: 30 Sep 2010, 1:08 PM
  2. Replies: 2
    Last Post: 19 Sep 2010, 7:22 AM
  3. TreeStore not updating? (source included)
    By british_trader in forum Ext GWT: Discussion
    Replies: 6
    Last Post: 25 May 2010, 4:35 AM
  4. Adding a model to TreeStore results in duplicate nodes
    By erincarikan in forum Ext GWT: Help & Discussion (1.x)
    Replies: 1
    Last Post: 25 Mar 2009, 1:20 PM

Posting Permissions

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