PDA

View Full Version : [CLOSED] Model instance get's parent Store as object after inserting



jeroenvduffelen
8 Jul 2010, 12:34 PM
Setting up a simple Store, creating a Model instance and than inserting that instance to the Store:




this.state.bookActiveChapters = new Ext.data.JsonStore({
autoLoad: false,
model: 'chapter',
storeId: 'activeChapters',
});
var emptyChapter = Ext.ModelMgr.create({
"id": "emptyChapter",
"next": 'none',
"prev": 'none',
"title": "No chapters loaded...",
"content": "Load chapters first."
}, 'book');
this.state.bookActiveChapters.insert(0, emptyChapter);


Results in a Model with the parent Store inside it...
21361

hendricd
20 Jul 2010, 7:23 AM
@ jeroenvduffelen (http://www.sencha.com/forum/member.php?154106-jeroenvduffelen) --

What you are seeing in the debugger is a simple reference to the owning store created when the Model instance is inserted into the store.

It is not a copy of the store, but a simple reference.