I am using a local storage proxy.
I want to create a record if it doesn't exist in the store, which works correctly and is persisted properly as well but when I update a record using setData(newData) and then call sync() it doesn't persist and the data is set back to what it was called the store.add(). I tried to call setDirty() on the record but then when I call sync(), I get an error:
Uncaught TypeError: Cannot read property 'isModel' of undefined
If I instead set a single property such as first name by calling set('FirstName','test') and then call sync(), it persists properly and doesn't throw an error even when I call setDirty().
var clientstore = Ext.getStore('clientstore');
/* findRecord( fieldName, value, [startIndex], [anyMatch], [caseSensitive], [exactMatch] ) */
var client = clientstore.findRecord('ID',responseData.Client.ID, 0, false, false, true);
client = Ext.create('dermix.model.Client', responseData.Client);