//Extjs 3.X
var record = new Ext.data.Record({
id: '1',
text: '你好!',
});
Grid.getStore().add(record);
//Extjs 4.x
Ext.define('Record', {
extend: 'Ext.data.Model',
fields: [
{ name: 'id', type: 'number' },
{ name: 'text', type: 'string' }
]
});
var record = new Record({
id: '1',
text: '你好!',
});
var rowlength = Grid.getStore().data.length + 1;
Grid.getStore().insert(rowlength, record );