Results 1 to 4 of 4

Thread: Storing JSON Objects Locally

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    11
    Vote Rating
    1
      1  

    Default Unanswered: Storing JSON Objects Locally

    Is it possible? I know you can't do it with local storage. Is the JSON Data Writer capable of doing this?
    Any help would be appreciated.

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Posts
    79
    Answers
    7
    Vote Rating
    1
      1  

    Default

    What exactly do you mean by storing? and why do you say that local storage can't do it?

    If you are getting data form an api or remote file you can store the response in a global javascript variable.
    Through ajax it would something like:
    Code:
    Ext.Ajax.request({
    	 url: 'http://someurl.com/data.json',
             reader: {
                type: 'json',
                rootPorperty: 'someRootProperty'
            },
    	 success: function(response) {
    	     someGlobalVariable = Ext.decode(response.responseText);
             }
    }):
    Some more info on what your trying to do would help us answer your question.

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Location
    Germany, Freiburg i. Br.
    Posts
    38
    Answers
    5
    Vote Rating
    14
      0  

    Default

    He wants to know if it is possible to store Data on Disk :-)

    But this Question isn't wrong anyway. The thinking is: I want to use Sencha Touch to replace developing native Apps. So I want to to work on Filesystem.

    What is the perfect answer to this?

    I was searching for the right way to design persisting Data like native Apps. Writing it to a cookie?

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Location
    bangalore
    Posts
    2
    Vote Rating
    0
      0  

    Default storing json objects locally its posible

    var store = Ext.create('Ext.data.Store', {
    model: 'Company',
    autoLoad: true,
    pageSize: 4, // items per page
    proxy: {
    type: 'ajax',
    url: 'gridpaging.json',
    reader: {
    type :'json',
    root: 'topics',
    totalProperty: 'totalCount'
    }
    }

    });
    when the url place you place json object with repect to dot json

Posting Permissions

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