Oracle Apex Column fix and Column Header sortable at the same time

486 Views Asked by At

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!

1

There are 1 best solutions below

0
Koen Lostrie On
  • 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"