PDA

View Full Version : [solved] treepanel and grid



stricte
3 Aug 2009, 4:52 AM
Hi,

i have a question. Can i get from data loaded by JsonStore some extra data? JsonStore has defined root and this is loaded, but next to, i'm sending some extra data.

ex.

by clicking leaf in the treepanel i'm loading data by store to mygrid. and this is working, but i want sth else, i want load some grid title together with grid array data.

sorry for my english, i know is su...

Animal
3 Aug 2009, 5:00 AM
I don't understand. But the following might be relevant:

http://extjs.com/deploy/dev/docs/?class=Ext.data.JsonReader&member=jsonData

stricte
4 Aug 2009, 5:02 AM
Ok. Sorry for that not clearly description. Let me clarify that with some code...


This is my standard grid


var grid_1 = new Ext.grid.EditorGridPanel({
store: protokol_store,
clicksToEdit: 1,
tbar: [{text: "Zapisz protokó?"}, {text: "Generuj raport"}],
cm: cm
});
This is my JsonStore


var protokol_store = new Ext.data.JsonStore({
autoDestroy: true,
url: '/grid/students',
root: 'students',
fields: ['name', 'surname', 'index']
});
This is structure of my Json object returned from
url: '/grid/students',

{'students' => {'name' => 'some name', 'surname' => 'some surname', 'index' => 'some index'}, 'some extra data array' => {'x' => x, 'y' => y}
}

And after store loading students are filling successfully my grid but i dont know how (if i can) read this extra data from json object to set in example title of my grid

Animal
4 Aug 2009, 5:06 AM
And I answered your question.

stricte
4 Aug 2009, 1:26 PM
yes. exactly. thank you very much.