1

I have the following problem: my requirement is that a column in Oracle APEX Interactive Grid should be fixed (i.e. the user must not be able to move it) but at the same time the sorting function must be available in the header column.

I've researched and tried various solutions but I'm still desperate. I tried this in the Column-> Advanced-> Column Initialization JavaScript Function -> config.defaultGridColumnOptions = noHeaderActivate: true and it doesn't worked - the column is so fixed, but you can't sort it that way either. Do you have any ideas how to solve this? Will appreciate your help very much!

Veli
  • 11
  • 1
  • What do you mean by "user cannot move column" ? Does that mean he cannot change the order of the column (actions > columns), or that he cannot change the width ? Or that he cannot hide it ? Or that the column is frozen using the "freeze" icon ? – Koen Lostrie Apr 18 '23 at 07:56
  • Hi thanks for your reply. I mean that the user cannot change the order of the column. – Veli Apr 18 '23 at 09:22

1 Answers1

0
  • Report Attributes: hide the actions menu (because use can re-order columns under columns option)
  • Column Attributes: Enabled Sorting, disable other options
  • In page attributes, under "Execute When page loads", add the following
// There is no supported way to turn off the ability to freeze columns. 
// This code removes the freeze button from the column header popup "menu". 
// DANGER. This is likely to break because of assumptions about markup especially the ids. 
$("#emp-ig2").on("gridactivatecolumnheader", function(e) 
{ setTimeout(function() 
  { 
      // The header popup "menu" is added to the end of the document so it is 
      // not clipped. You will no longer find it under the IG region. 
      $("#emp-ig2_ig_column_header_menu").find("[data-option='freeze']").remove(); 
  }, 1); 
});

Note that in the example above the static id for the ig is "emp-ig2"

Koen Lostrie
  • 14,938
  • 2
  • 13
  • 19