Author Topic: Hide current column from header context menu  (Read 300 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Hide current column from header context menu
« on: January 18, 2023, 02:16:31 pm »
Trying to hide current column from header context menu:

Code: [Select]
function headItems(evt, ui){
  return [
    {
          name: 'Hide column',
          action: function (evt, ui) {
     
            var grid = this,
            column = ui.column
           
            this.Columns().hide({ diHidden: [column.name] });
          }
    }
  ]
}

But can't get it to work properly.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Hide current column from header context menu
« Reply #1 on: January 18, 2023, 02:47:29 pm »
Correction:

Code: [Select]
this.Columns().hide({ diHide: [column.dataIndx] });

https://paramquery.com/pro/api#method-Columns