jeroenvduffelen
28 Jun 2010, 2:24 AM
I've got a simple model here:
Ext.regModel('book', {
idProperty: 'bookId',
fields: [
{name: 'bookId', type: 'string', defaultValue: 'grmbl..'},
{name: 'bookTitle', type: 'string'},
],
});
var objBook = Ext.ModelMgr.create({}, 'book');
When create a new instance of this model without any values i get a clean new object as a result:
21142
var objBook = Ext.ModelMgr.create({
bookId: 'testId',
bookTitle: 'testTitle',
}, 'book');
But when I create a new instance of this model with values i get a dirty object like this:
21141
So it doesn't only add the field values to the data object inside the model but it adds the values to the object itself as well....
Ext.regModel('book', {
idProperty: 'bookId',
fields: [
{name: 'bookId', type: 'string', defaultValue: 'grmbl..'},
{name: 'bookTitle', type: 'string'},
],
});
var objBook = Ext.ModelMgr.create({}, 'book');
When create a new instance of this model without any values i get a clean new object as a result:
21142
var objBook = Ext.ModelMgr.create({
bookId: 'testId',
bookTitle: 'testTitle',
}, 'book');
But when I create a new instance of this model with values i get a dirty object like this:
21141
So it doesn't only add the field values to the data object inside the model but it adds the values to the object itself as well....