28 Dec 2011 5:52 PM #1
change to ext.data.model behavior
IN the old version I could call set on a field that did not exist (ie not declared in the fields array) and all was well, everything worked. In 4.1 that doesnt work. MY problem is that I dont know the fields I am going to get until very late - i get data from my server and it has fields in it; i just load them into the model object and off we go. I will admit that for some (not all) fields i did ext.apply(item.data, serverObject); which is not strictly speaking following the published interface but worked very nicely. Certainly there is no way that I can statically define a separate model item for my objects, I do not know in advance what they will be. Today I have just one 'abstract' class that has a well known set of control fields on it
29 Dec 2011 9:10 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
There were reports that people didn't like the fields being changed. If the current behavior doesn't sit well for you then you can change the data object yourself and set the dirty flag. The only problem is if you require the use of the model/store keeping record of the modifications.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
29 Dec 2011 9:25 AM #3
not sure i understand
>>There were reports that people didn't like the fields being changed.
dont know what that means
>>If the current behavior doesn't sit well for you then you can change the data object yourself and set the dirty flag.
By 'current' do you mean 4.0.7 or 4.1?
If you mean that I should change my 4.1 test code to call setDirty after I merge my data into the model object - this doesn't work. The getData function (called by gird and tree) only returns data from defined fields
29 Dec 2011 11:04 AM #4
simple work round for me was to override the getData method
not subtle - but effective