i want to add data at the end of json file.I am confused.what I did is I add the following code to it but not working.
PersonRecord= Ext.define('Persons',{
extend:'Ext.data.Model',
fields:[......]
});
var ds=new Ext.data.Store({
storeId: 'person',
model: 'Persons',
autoLoad: true,
proxy: {
type: 'ajax',
url: '../data.json',
reader:{
type: 'json',
root:'pers'
}
}
});
.....
'id':Ext.id(),
'fName':fName,
'lName':lName,
'fatherName':fatherName,
'nationalCode':nationalCode,
'tell':phone
});
ds.add(record);
ds.commitChanges();
but dont work. i can load data from json but can not add new record to json