ext 动态增加grid内容
?
var store = Ext.getCmp('gridPanelId').getStore();
?
var value1 = "";
var value2 = "";
//增加grid中数据
var onerecord = store.recordType;
var data = new onerecord({
header1: value1,
header2?: value2
});
store.add(data);
?
//删除grid中数据
var sm = Ext.getCmp('gridPanelId').getSelectionModel();
if(sm.hasSelection()){
var selectRecord = sm.getSelected();
var store = Ext.getCmp('gridPanelId').getStore();
store.remove(selectRecord);
}
?