Skip to content Skip to sidebar Skip to footer

How To Save Json File When Use It As Extjs Grid Store

I have developed application which use ExtJs functionality where I should keep my store in json file. My store looks like this: var Grid1Store = new Ext.data.JsonStore({ field

Solution 1:

You cannot edit files in Javascript that are fetched with HTTP.

To be able to update the data, you should save your data in a database, and have PHP (or your server side language) outputting the file something.json (which would rather be something.php).

Then you add a writer configuration to your proxy, like

proxy:{
    type:'ajax',
    url:'resources/buildJsonStore/something.json',
    reader:{
         type: 'json'
    },
    writer: 'json'
}

Your file something.php will then have to update the databse with the changed data.

Post a Comment for "How To Save Json File When Use It As Extjs Grid Store"