View Full Version : ExtJS Grid storing Cell State automagically

26 Sep 2012, 11:33 PM
I am porting quite a huge piece of software to an ExtJS TreeGrid. Lots of data (and I mean lots of data) is loaded on-demand into spans that are placed inside grid's cells.
Imagine grid cells having <span id="foo_bar'></span> as content, and special ajax handlers are polling the backend for updated information and once available the spans are filled with it.
Now, in case I collapse some part of the tree-grid and then re-exand them again I loose all automatically filled cell content, and am left with empty spans (which I started from in the first place).
I know the correct way is to setup a store and push all data into the store. But as I've mentioned above: I am porting quite a huge piece of legacy software to ExtJS, and I do not really have much choice here.
Is there a way to automagically push grid cell values to the store?
A grid is loaded with, suppose, 2000 cells (this can vary tremendously). Every cell contains various grades of HTML, mostly this is , but this can be pretty much anything (including several spans or divs in one cell). In the background there is a comet process pushing new data to the HTML page almost in real time. This data is populated to the corresponding SPANS and DIVs either based on their IDs or class or both.
What I want to achieve is that either: a) the model for the grid is atomagically updated with the new html content of the cells (how can I achieve this)? b) when collapsing/expanding tree's nodes the model data is NOT reloaded afresh.
Is either a or b possible? if so how?

It would totally suffice if when expanding a tree-grid node that it loads its contents from the backend again. Is that perhaps possible?