1. #1
    Sencha User
    Join Date
    Jun 2013
    Location
    India
    Posts
    15
    Vote Rating
    2
    Answers
    1
    narainkartha is on a distinguished road

      0  

    Default Unanswered: Update data to json local file - Sencha touch

    Unanswered: Update data to json local file - Sencha touch


    Can anyone help me to update data to json file? I am able to read data from json file and show it in a web browser fields. But i failed to update the data back to json file(which is stored in a local folder) after making some changes to data. I tried with jsonwriter's write method, but I am not able to write the correct syntax/code of the same. I am fairly new to Sencha touch technology.

    Thank you in advance!

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Location
    Pakistan
    Posts
    82
    Vote Rating
    2
    Answers
    3
    zonaib is on a distinguished road

      0  

    Default


    try this

    Code:
    Ext.define('User',{
        extend:'Ext.data.Model',    config:{        fields:['id','name','email']}});var store =Ext.create('Ext.data.Store',{    model:'User',    proxy:{        type:'ajax',        url :'path for data.json file',        reader:{            type:'json'}} });

  3. #3
    Sencha User
    Join Date
    Jun 2013
    Location
    India
    Posts
    15
    Vote Rating
    2
    Answers
    1
    narainkartha is on a distinguished road

      0  

    Default


    Hi Zonaib,

    Thank you for your reply.

    I already have the model and store defined in my application. What I am looking for is the code to update the data to local json file by some method.

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Location
    Pakistan
    Posts
    82
    Vote Rating
    2
    Answers
    3
    zonaib is on a distinguished road

      0  

    Default


    hi
    as you know this is js project and all files are being loaded on at the first time of project loaded, so for me we cannot update file for the future purposes ,
    btw why you dnt store data on your server ?
    if you dnt want to you server side stuff then you can use SQLite (upto 5mb)

  5. #5
    Sencha User
    Join Date
    Jun 2013
    Location
    India
    Posts
    15
    Vote Rating
    2
    Answers
    1
    narainkartha is on a distinguished road

      0  

    Default


    Hi Zonaib,

    Thank you again!!!

    I am creating a sample application as part of a demo, and my plan was to just use the json file to add/update data. But from your reply I suspect that is not possible so let me try with SQLite.

  6. #6
    Sencha User
    Join Date
    Jul 2011
    Location
    Pakistan
    Posts
    82
    Vote Rating
    2
    Answers
    3
    zonaib is on a distinguished road

      0  

    Default


    best of luck

Thread Participants: 1