Author Topic: Reset columns visibility  (Read 2604 times)

przemek

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Reset columns visibility
« on: April 28, 2014, 04:35:29 pm »
Hello,

I'm using Param Query script to show/hide columns and i would like to know how to bind "reset" action after which all columns will be visible and in the original order.

Please tell me how to do it :)

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Reset columns visibility
« Reply #1 on: April 28, 2014, 09:34:12 pm »
colModel is an array of columns

You can reset all columns to visible by updating their hidden property to false in a loop

Code: [Select]
var CM = $grid.pqGrid( "option" , "colModel" );
for( var i=0;i< CM.length; i++ ){
  var column = CM[ i ];
  column.hidden = false;
}
$grid.pqGrid( 'refresh' );