PDA

View Full Version : value from JsonStore



crazy
25 Sep 2009, 12:56 AM
hi all,

i am giving my code below.



var testStore = new Ext.data.JsonStore({url: 'getImages.php',
root: 'imageDetails',
autoLoad: true,
fields: [{name: 'from', type: 'string'}, {name: 'details', type: 'string'}, {name: 'comments', type: 'string'}, 'url']});




imagePanel = new Ext.Panel({
height: 500,
frame: true,
autoScroll:true,
items: [ new Ext.Panel({
items: new Ext.DataView({
store: testStore,
tpl: tpl,
itemSelector:'div.thumb-wrap'
}),
html: '<br /><br /><hr /><br />'
})
]
});



and my question is how can i retrieve the values from each fields('from, 'details' ...)

in my 'imagePanel', i am getting the image from the url
but how i get the other details....

help plz...

http://www.extjs.com/forum/images/misc/progress.gif

crazy
25 Sep 2009, 1:53 AM
hi,

i am creating a page nearly similar to scrap page of orkut or something like that.
for this, how can i display the old scraps
i got all the values in a JsonStore.
i tried for a long time, but i couldnt find how to display that results....
thats my problem.

Nagadev
25 Sep 2009, 2:03 AM
you may loop through the store and fetch the values


var fieldValue;
mydatastore.each(function(record) {
record.fields.each(function(field) {
fieldValue = record.get(field.name);
});
}, this);

crazy
25 Sep 2009, 2:19 AM
you may loop through the store and fetch the values


var fieldValue;
mydatastore.each(function(record) {
record.fields.each(function(field) {
fieldValue = record.get(field.name);
});
}, this);



hi thanks for the reply.