ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on January 18, 2023, 02:16:31 pm

Title: Hide current column from header context menu
Post by: queensgambit9 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.
Title: Re: Hide current column from header context menu
Post by: paramvir on January 18, 2023, 02:47:29 pm
Correction:

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

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