TreePanel check changed events??

TreePanel check changed events??

Hi,

I would like to know why i click on a leafNode, Node A with 3 children, the Events.CheckChange listener will be fired for 3 times. Is there any listener that listen to the tree panel, even i checked the root node, it is only fired once. This is because i need to get the checked items and pass the checked items information to database and get the data to build other tree. i dont want the Events.CheckChange is fired 3 times and go to database 3 times.

whatever which of the following listener is used, if you check the leafNode, they will be fired many times which depend on how many children the node has.

First post

First post

The TreePanel documentation stats that the event CheckChange "Fires after a item's check state changes.".

However, there is also the event "CheckChanged" which documentation says "Fires after the tree's overall checked state changes." Nevertheless, this event is also called several times when the parent of other check nodes is checked. I don't know if it is a bug or if it is the expected behavior, but I've made a change to the ThreePanel class so that CheckChanged behave like we thought it should do.

I added a cascade version of the method "setChecked" that I call "setCascadeChecked" which is a copy of "setChecked" whithout firing CheckChanged. Then I modified the method "onCheckCascade" to call setCascadeChecked instead of setChecked. Here is the code for both methods: