PDA

View Full Version : Read TreeGrid data



Dafram
10 Sep 2013, 4:40 AM
Hi!

I have created a Tree Grid, with:

plugins: [cellEditing]

Now, after the user has finished to edit the tree, there is a SAVE button to save the changes into database.

But I don't know how to read the tree grid and send the data to AJAX.

Can you help me, please?

PS: I tried storeTreeLabels.proxy.reader.rawData but it shows only the first level of the tree content...

45742

ettavolt
10 Sep 2013, 4:44 AM
You may want to call TreeStore.sync(); on 'Save' click.

Dafram
10 Sep 2013, 6:51 AM
You may want to call TreeStore.sync(); on 'Save' click.

I tried, but I have the same error... :(


storeTreeLabels.sync();
var l = storeTreeLabels.proxy.reader.rawData;
console.log(l);

ettavolt
10 Sep 2013, 9:01 PM
Sync will save all dirty tree node using configured proxy. Of course, if it is memory proxy, you won't see any requests.

Dafram
13 Sep 2013, 1:28 AM
I have found a way to read my tree data:


// Nodo Root
rn = treeLabels.getRootNode();
// Loop sul tree
rn.eachChild ( function(label) {
// label.data.text
label.eachChild ( function(riga) {
// riga.data.text
});
});