1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    11
    Vote Rating
    1
    chibrolzy is on a distinguished road

      1  

    Default Unanswered: Storing JSON Objects Locally

    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
    Vote Rating
    1
    Answers
    7
    jonathansimmons is on a distinguished road

      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
    31
    Vote Rating
    8
    Answers
    4
    StudentDaniel will become famous soon enough

      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
    sharibabu is on a distinguished road

      0  

    Default storing json objects locally its posible

    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