How to dynamically modify the display and hiding of columns:The following is the sample code:
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 );}
Note that the following are:When the column is configured with theGridshow : false, you can't find the Column object. can be written in the refreshCall:
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);
}
}
},
From for notes (Wiz)