PDA

View Full Version : Pons Asinorum of Grid Panel: Stick new data in there -- right now



bimargulies
12 Aug 2012, 4:40 AM
I want to replace the contents of a grid with data I have in my electronic fingers right now. I do not want a proxy making an Ajax call on my behalf. I just want to load new data.

In the tree panel, there is setRootNode, and that's quite convenient for this. If there's an equivalent for the grid panel, I'm failing to detect it.

The examples in 'Store' for the load functions aren't quite informative to me of which of them would just take an array of items just as I would supply to the data: of a memory proxy.

I suspect that the answer to this is trivial, and I promise to decorate the doc with comments to help the next in line after me.

mankz
12 Aug 2012, 6:52 AM
yourStore.loadData(arrayOfAwesomeDataBits);

bimargulies
12 Aug 2012, 8:38 AM
Thanks. Could I please drag you from the grid to the tree, then? The treepanel has a setRootNode. Howcome? Why not just call loadData?

mankz
12 Aug 2012, 8:46 AM
A flat data store has a very different api compared to a flat store, which has no root node.