在实际项目开发中,对于登录人权限的不同,会限制不同的操作,如:在ext中grid有某列,根据登录人是否有权限判断当前这是否可以更改数据:
如有某列:
{id:'adjustExcludeTaxPrice',header : "新去税单价",width : 90 ,<span style="color: #FF0000;" mce_style="color: #FF0000;">editor: new Ext.form.NumberField({ allowBlank: true,allowNegative:false})</span> 红色部分意思为:此列有可编辑属性 如果当前登录人没有权限,那么将此列改为不可编辑://根据ID 得到列索引 var cl = outGrid.getColumnModel().getIndexById("adjustExcludeTaxPrice"); //设置该lie为不可编辑。 outGrid.getColumnModel().setEditable(cl, false);