Author Topic: To hide the individual sub column of main column  (Read 2597 times)

bsolteam

  • Pro Deluxe
  • Full Member
  • *
  • Posts: 107
    • View Profile
To hide the individual sub column of main column
« on: April 24, 2017, 01:14:21 pm »
Hi Team,
I am trying to hide the sub column of a main column.
var CM = $("#vessel_tab_main").pqGrid("option", "colModel");
CM[13].colModel[12].hidden = true;
where CM[13]  is a main column and colModel[12] is sub column of CM[13].
I have tried to add "CM[13].colModel[12].hidden = true;" code in my change function,still it's not working.But i  tried to hide the main column CM[13],all the sub columns are also getting hidden.
 
I need your help while trying to hide the individual sub column of a main column,what i need to do.Please reply soon.

Thanks
Bsol Team


 

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: To hide the individual sub column of main column
« Reply #1 on: April 24, 2017, 06:30:18 pm »

bsolteam

  • Pro Deluxe
  • Full Member
  • *
  • Posts: 107
    • View Profile
Re: To hide the individual sub column of main column
« Reply #2 on: April 27, 2017, 12:21:48 pm »
Hi Team,

var CM = $("#vessel_tab_main").pqGrid("option", "colModel");
CM[13].colModel[12].hidden = true;
$( "#vessel_tab_main"  ).pqGrid( "option", "colModel", colM );

My requirement is like as per the attached screen shot when i select the option 'DRAFT DWTS' the sub column 'Deadweight Thirteen' should be hidden.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: To hide the individual sub column of main column
« Reply #3 on: April 27, 2017, 09:49:11 pm »
Any column / columns ( main or sub column ) can be hidden by setting hidden property to true.

followed by

grid.option("colModel", grid.option("colModel")); //refresh the colModel., refreshCM() can also be used instead.
grid.refresh();

Note that show/hide of grouped columns is supported only > v3.3.x