PDA

View Full Version : please help me! about record



var123
16 Jun 2007, 8:01 PM
why the p can not add in ds????
action.result.data is {A0101:"98789276"}
It work, if i do this:
var p = new ComboRecord({A0101:"98789276"});
how to modify the code:
var p = new ComboRecord(action.result.data);

/////////////////////////////////////////
success: function(form, action) {
ComboRecord = Ext.data.Record.create({name: 'A0101', type: 'string'});
var p = new ComboRecord(action.result.data);
ds.add(p);
grid.getView().refresh();
}

Animal
16 Jun 2007, 10:27 PM
Do not call Ext.data.Record.create multiple times. It creates a Record constructor which you keep a reference to and use from then on.