1
votes

I have a treestore in which all nodes have the initial config checked:false , so that a checkbox will appear, allowing the user to check items in the treepanel. I then get the checked items from the treestore and move them to another treestore, in another tree panel. My question is how do I, when moving the node, make sure it is not checked in the treepanel it is moved to?

Here's what I have done:

I have gotten a reference to the node I am moving(adding to one store, removing from the other), and I have set it's config checked:false. When I view the node in firebug after it is within the new treestore, sure enough, checked:false, which is what I wanted, however, within the panel, visually, it is still checked. So How do I make it uncheck??

2
Please post your code. It’s not clear what exactly you are doing. – Vasiliy Faronov
for various reason I can't post the code. The problem boils down to the last sentence. If you change checked to false, in the code, in firebug, or otherwise. The node remains checked. How do I update the treepanel to display the changes? – Bbb
please try to give us a simple example, I can think of a variety of reasons why this is happening, but I can't tell you which one without an example – Reimius

2 Answers

0
votes

There are a couple of reasons why this could be happening.

  1. The dataIndex of the new column does not match the dataIndex of the old column(in the case of using a treegrid)

  2. Your model assigned to both stores is not the same Ext.data.Model in both cases.

  3. I have noticed some weirdness with treenodes and attributes not working if you don't specifically add that config option to your Ext.data.Model. So try assigning the same model to both trees with "checked" as one of the fields with dataType: "boolean"

0
votes

I had the same problem last week. I made this kind of operations last week to solve it:

    currentNode.data.checked = false;
    currentNode.raw.checked = false ;
    currentNode.triggerUIUpdate();

It seems it didn't work without the triggerUIUpdate. I am working with extjs4.2.1