Results 1 to 4 of 4

Thread: value from JsonStore

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    50

    Cool value from JsonStore

    hi all,

    i am giving my code below.

    Code:
    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']});
    Code:
    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...

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Posts
    50

    Default value from JsonStore

    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.

  3. #3

    Default

    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);

  4. #4
    Sencha User
    Join Date
    Jul 2009
    Posts
    50

    Default

    Quote Originally Posted by Nagadev View Post
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •