View Full Version : Prevent a Treegrid rerendering from the store when opening closing nodes

3 Oct 2011, 8:03 AM
I have a treegrid that contains drop downs in each node.

The drop downs can be changed, which triggers an ajax request that updates the backend.

The problem is that when you open or close a node it seems the tree grid is rerendered using the data in the store, which is now old.

Is there a way to prevent the tree grid from rerendering the nodes, ideally I'd like to create and render the tree grid once on page load then leave it alone.

Any suggestions very welcome.

3 Oct 2011, 4:30 PM
I think you may struggle. Trees and grids re-render themselves as they see fit and assume it's always safe to do so. Any state needs to be saved in the record but that can also prove troublesome as updating a record causes an immediate re-render. In your case maybe it makes sense to update the records either when you persist to the server or alternatively when a collapse event occurs?

Could you post a short code example of what you're doing?

3 Oct 2011, 5:03 PM
Code sample will be tricky, I'll try and mockup an example with just the essentials to demonstrate the issue.

I think the real problem is I'm using a tree grid when I probably should be using a custom UI widget. I'm probably only using 10% of the tree functionality (mainly layout and expand/contract) I'm getting the feeling the other 90% (lazy loading rerendering, etc) is slowing things down and getting in the way.

So I might build what I need from scratch to do specifically what I need rather than rely on an OOTB widget in this instance.