lfs2008
21 Sep 2012, 1:48 AM
Hi all!
I have such a button handler in Extjs 4.1.0 controller.
Restful store is already loaded.
If i start editing any record - it works fine.
If i add emptyRecord to non-empty store - it works fine.
The issue is - emptyRecord.store is null if emptyRecord added to an empty store (0 records were loaded).
Ext.create() just returns record store 'null' with no exceptions.
Even more - emptyRecord.store stills null even after i manually set
emptyRecord.store = store.
Thus after completeEdit methood call in Roweditor.js nothing happend - because emptyRecord not bound to any store.
Editor just being hidden and no ajax call performed.What should i debug next? any clues?
...
var grid = Ext.getCmp('app-id-dataconsumerspanel'),
_model = 'te.model.DataConsumer',
_store = 'te.store.DataConsumer',
store = Ext.getStore(_store),
rowEditing = grid.plugins[0]
var emptyRecord = Ext.create(_model , {
name:'',
});
if (!emptyRecord.store){
emptyRecord.store = store;
}
console.log(emptyRecord);
store.insert(0, emptyRecord);
rowEditing.startEdit(emptyRecord, 0);
I have such a button handler in Extjs 4.1.0 controller.
Restful store is already loaded.
If i start editing any record - it works fine.
If i add emptyRecord to non-empty store - it works fine.
The issue is - emptyRecord.store is null if emptyRecord added to an empty store (0 records were loaded).
Ext.create() just returns record store 'null' with no exceptions.
Even more - emptyRecord.store stills null even after i manually set
emptyRecord.store = store.
Thus after completeEdit methood call in Roweditor.js nothing happend - because emptyRecord not bound to any store.
Editor just being hidden and no ajax call performed.What should i debug next? any clues?
...
var grid = Ext.getCmp('app-id-dataconsumerspanel'),
_model = 'te.model.DataConsumer',
_store = 'te.store.DataConsumer',
store = Ext.getStore(_store),
rowEditing = grid.plugins[0]
var emptyRecord = Ext.create(_model , {
name:'',
});
if (!emptyRecord.store){
emptyRecord.store = store;
}
console.log(emptyRecord);
store.insert(0, emptyRecord);
rowEditing.startEdit(emptyRecord, 0);