Results 1 to 2 of 2

Thread: Load object from localStore

  1. #1
    Ext User
    Join Date
    Aug 2010
    Posts
    7
    Vote Rating
    0
      0  

    Default Load object from localStore

    Hi everybody,

    i want to make a json result offline available. So i saved the callback result like...
    Code:
    log(value) // [Object, Object, ..., Object]
    log(typeof value) // its an object
    localStorage.setItem('storeName', value);
    ... but after i load it, it is like ...
    Code:
    var value=localStorage.getItem('storeName');
    log(value) // [object Object],[object Object], ..., [object Object]
    log(typeof value) // now its a string
    Is there a way to realize that?

  2. #2
    Touch Premium Member
    Join Date
    May 2010
    Location
    The Netherlands
    Posts
    46
    Vote Rating
    0
      0  

    Default

    if you use the Store framework from Sencha, it will encode the object itself... if you are using the windows.localStorage directly, you must encode the object yourself by using Ext.decode/Ext.encode when saving and retrieving...

Similar Threads

  1. How to load JsonStore object from an existing JSON object/array
    By guyza in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 16 Sep 2010, 2:50 PM
  2. Load Json object in form
    By couetbis in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 18 Mar 2009, 12:49 AM
  3. Load DataStore from existing object?
    By mtrpcic in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 2 Jul 2008, 12:56 PM
  4. how form.load() from a custom object
    By prajith in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 15 Oct 2007, 1:46 AM
  5. Load Grid w/JSON object
    By wfrishse in forum Ext 1.x: Help & Discussion
    Replies: 8
    Last Post: 7 Aug 2007, 2:17 PM

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
  •