PDA

View Full Version : TreeStore double fires each update event?



lrayman
20 Aug 2013, 1:25 PM
I have a TreeStore that polls the server on a timer. Based on the response, the store then updates (or appends) some of its records.

My TreePanel has a listener on the store's update event (which highlights the updated cell for a few seconds).

I saw that the update listener was getting called twice for each update. From some digging, I found that, in addition to the store proper was firing the event (as expected), the tree view's NodeStore object was also firing the same event.

Has anyone else out there seen this issue? Is there a config option on the view to prevent the double firing?

I'm running extjs v 4.1.3

Thanks

slemmon
22 Aug 2013, 9:15 PM
You might suspend the event on the view only:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.tree.View-method-suspendEvent

lrayman
23 Aug 2013, 4:39 AM
that seems dangerous! How would the panel and the view keep in sync if the events are suspended?

and, I'm still on 4.1.3 - that method was only invented in 4.2 :(

slemmon
23 Aug 2013, 9:08 AM
Can you share your code for how you set up the listener on the TreePanel for the store's update event?