Author Topic: Issue with Show/hide column on in Group header Grid  (Read 3111 times)

cijojohn

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 73
    • View Profile
Issue with Show/hide column on in Group header Grid
« on: June 17, 2017, 04:25:55 pm »
Hi Team,

I am Facing Issue with show/hide column in group header.

I want , when i pass parent dataindex of 1st level then it should hide all the child of this column.

And when i pass dataindex of child level it should hide that column only.

Please advise.

Thanks,


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Issue with Show/hide column on in Group header Grid
« Reply #1 on: June 19, 2017, 11:10:19 am »
dataIndx is used for data binding. Only child level columns are data bound and thus have dataIndx.

Parent columns don't have dataIndx.

Here is the example for show/hide column example for child level columns. https://paramquery.com/pro/demos/showhide_groups

Parent columns can be identified by colIndx.

var CM = grid.option('colModel');

CM[0].hidden = true; //hide top level column with colIndx: 0

grid.refreshCM(); //refresh colModel.

grid.refresh(); //refresh view.

cijojohn

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 73
    • View Profile
Re: Issue with Show/hide column on in Group header Grid
« Reply #2 on: June 20, 2017, 02:21:07 pm »
Hello team,

this is not working for me. because i am hiding child level as well as parent level both at a time for child level it is working.
But for parent its not.

Please Suggest.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Issue with Show/hide column on in Group header Grid
« Reply #3 on: June 20, 2017, 03:01:01 pm »
When you hide the parent column, child columns are hidden too.
      
There is no GUI, you have to do it with code.

For this example: https://paramquery.com/pro/demos/showhide_groups, top level columns can be hidden as

Code: [Select]
var CM = grid.option('colModel');

CM[0].hidden = true; //hide first top level column ( Some No)

CM[1].hidden = true; //hide company column

CM[2].hidden = true; //hide "Balance Sheet" column

grid.refreshCM(); //refresh colModel.

grid.refresh(); //refresh view.

cijojohn

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 73
    • View Profile
Re: Issue with Show/hide column on in Group header Grid
« Reply #4 on: June 21, 2017, 07:45:34 pm »
that is fine, individually it is working but when we implement child level and parent level show hide at a time then it is creating problem for me. i m hiding child and parent column in different column not at same same column. because i have such requirements like for one column i have to hide some column and for other i have to hide all columns. and i have some child column those need to be hidden always.
« Last Edit: June 21, 2017, 07:51:03 pm by cijojohn »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Issue with Show/hide column on in Group header Grid
« Reply #5 on: June 22, 2017, 09:04:21 am »
That shouldn't be a problem. The columns can be hidden/ shown in any possible combinations. Columns which need to hidden all the times could be moved out of the grouped columns.

Can you please share a jsfiddle of the issue you are facing, so that I can help you.