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
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