向store中手动增加和移除数据
//获得表格中被选中的记录条数
var records = sla_addslm_grid.getSelectionModel().getSelections();
//遍历记录数
for(var i=0;i<records.length;i++){
//取得每条记录的字段值
var slmId=records[i].get("slmId");
var slmTitle=records[i].get("slmTitle");
var slmAppObj=records[i].get("slmAppObj");
var slmType=records[i].get("slmType");
//拼成JSON格式
var params={slmId:slmId,slmTitle:slmTitle,slmAppObj:slmAppObj,slmType:slmType};
//向Store中手动增加数据
sla_form_slaSlmStore.add(new Ext.data.Record(params))
}
//获得表格中的记录数
var records = sla_form_slaSlmGrid.getSelectionModel().getSelections();
//遍历记录数
for(var i=0;i<records.length;i++){
//从Store中移除记录
sla_form_slaSlmStore.remove(records[i]);
}