Extjs隐藏某列
如何在动态的修改列的显示和隐藏:
下面为示例代码:
if(matchStatus.getValue()=="weipp"){ colMode=this.getColumnModel(); var handColIndx=colMode.findColumnIndex("match"); colMode.setHidden(handColIndx,false); }else{ var colMode=this.getColumnModel(); var handColIndx=colMode.findColumnIndex("match"); colMode.setHidden(handColIndx,true); }
注意的是:当列当中配置了gridShow : false,的时候,就无法找到列对象了
可以写在refresh中
调用:
listeners :{afterrender :function(){var thisGrid =this;var colMode = thisGrid.getColumnModel();var handColIndex = colMode.findColumnIndex('satisfactionName');if(thisGrid.petitionTypeCode==3){colMode.setHidden(handColIndex,false);}else{colMode.setHidden(handColIndex,true);}}},

浙公网安备 33010602011771号