Author Topic: Freeze columns with hidden columns  (Read 1494 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Freeze columns with hidden columns
« on: March 25, 2021, 02:49:00 am »
It is possible to freeze columns based on visible columns instead of all?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Freeze columns with hidden columns
« Reply #1 on: March 25, 2021, 06:33:11 pm »
Please use this to ignore hidden columns.

Code: [Select]
listener: function (evt) {
var val = evt.target.value, val2 = 0, indx2;
this.getColModel().forEach(function(col, indx){
if( !col.hidden ){
if(val2 == val){
indx2 = indx;
}
val2 ++;
}
});
        this.option("freezeCols", indx2 );
        this.refresh();
}                                           

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Freeze columns with hidden columns
« Reply #2 on: March 26, 2021, 05:01:28 pm »
Please also check this example based on your requirement:

https://paramquery.com/pro/demos/freeze_columns_visible
« Last Edit: March 26, 2021, 06:30:33 pm by paramvir »

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: Freeze columns with hidden columns
« Reply #3 on: March 28, 2021, 06:22:19 pm »
Thank you, seems to work but having issue with column headers overlapping when scrolling. Any idea what might be causing this?