var gh_xz_fgtjmonth_store=new Ext.data.JsonStore({
url:"zbManage.html?m=getZbManageJson",
baseParams : {DYear:''},
root:"results",
totalProperty:"totalCount",
fields:['zyzbid','zbmc','yearZbid'],
listeners: {
load: function(store) {
var index = 0;
store.each(function(record) {
if(record.data.yearZbid !="") {
sm.selectRow(index,true);
}
index++;
})
}
}
});
//////数据加载的时候 yearZbid 不为空的 都要选中 可是每次点击gridpanel后,加载后选中的行都失效了 只剩下点击的行还在勾选。我需要最后勾选的要保存的,看看是不是得加个监听什么的?
var sm = new Ext.grid.CheckboxSelectionModel();
var gh_xz_fgtjmonth_grid = new Ext.grid.GridPanel({
loadMask:true,
store: gh_xz_fgtjmonth_store,
autoScroll: true,
width:xz_fgtjmonth.getComputedWidth(),
//定义相关列头
columns: [
new Ext.grid.RowNumberer(),
sm,
{id:'zyzbid',header: "指标id", width: 100, sortable: true, dataIndex: 'zyzbid'},
{id:'zbmc', header: "指标名称", width: 50, sortable: true, dataIndex: 'zbmc'}
],
sm:sm,
stripeRows: true,
autoHeight:true,
})
});