Results 1 to 4 of 4

Thread: how to get data in a json store

  1. #1
    Sencha User
    Join Date
    Oct 2010
    Location
    philippines
    Posts
    26

    Default how to get data in a json store

    Hi,

    Please let me know how can I get the record in a json store.

    I have this store upon reload I want to filter the record for some implementation.

    AccessStore.reload({
    params : {
    func: "103",
    propertyId : '1',
    moduleId : '2',
    userId : '2'

    }
    })

    var records = AccessStore.data.items;
    r = records[0].getAt(1);

    alert(r);

    I cannot get the data of the store. Anyone can help?
    I'm a web developer/software engineer and a business coach who helps those new to online marketing or who are in direct sales generate a steady flow of fabulous leads using on-line business tools. I love helping people generate more sales & income without having to experience rejection & frustration.

    http://edwindeloso.com

  2. #2
    Ext User
    Join Date
    Sep 2010
    Location
    Baltimore, MD
    Posts
    66

    Default

    is your code written just like that, straight in line? Have you tried writing an event handler, like in AccessStore.on('load', function ...

    This way you can move your code where you try to access the records to a place inside the event handler

    Otherwise you are trying to do records[0].getAt(1) before any data is even in the store

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Loading is asynchronous. Calling load() only sends a request to the server and all code after that will execute directly after that.

    You have to wait for the server to respond. You can do that by using a load event handler (like @Foster already metioned) or by using the callback option in the reload parameter.

  4. #4
    Sencha User
    Join Date
    Oct 2010
    Location
    philippines
    Posts
    26

    Default

    Thanks foster and condor.

    I got it.
    I'm a web developer/software engineer and a business coach who helps those new to online marketing or who are in direct sales generate a steady flow of fabulous leads using on-line business tools. I love helping people generate more sales & income without having to experience rejection & frustration.

    http://edwindeloso.com

Similar Threads

  1. can i store json string to Ext.data.store?
    By a2rdvark in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 28 Oct 2010, 3:26 PM
  2. No data in JSON Data Store from remote file
    By uwe99 in forum Ext 3.x: Help & Discussion
    Replies: 9
    Last Post: 27 Feb 2010, 11:32 PM
  3. JSON Store isn't loading JSON Data
    By WhirlingDerBing in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 3 Nov 2009, 4:37 PM
  4. Second json store is created under each returned json Store.data.item
    By daddyschmack in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 19 Aug 2009, 4:34 AM
  5. create Json store with local json data
    By gadgetfbi in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 21 Dec 2007, 7:05 AM

Tags for this Thread

Posting Permissions

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