I have a strange requirement that involves changing the headers of columns within an interactive grid from a popup LOV page item without the need to submit/reload the page every time the parameter changes.
My first thought was to have some javascript code that messes with the headers that gets executed from a Dynamic Action. Here is the code I have so far:
var parts_arr = $v("P200_PARTS_SELECTION").split(':'),
col_staticID_arr = ['#part-1_HDR', '#part-2_HDR', '#part-3_HDR', '#part-4_HDR', '#part-5_HDR',
'#part-6_HDR', '#part-7_HDR', '#part-8_HDR', '#part-9_HDR', '#part-10_HDR'
];
for (let i = 0, len = parts_arr.count; i < len; i++) {
$(col_staticID_arr[i]).text(apex.item("P200_PARTS_SELECTION").displayValueFor(parts_arr[i]));
};
This unfortunately does not work for a few reasons, firstly it seems that I can’t use a variable or even a concatenated string in the $(...).text
field. Secondly, the displauValueFor(...)
field only seems to pull the display value of P200_PARTS_SELECTION
when it only holds one value.
However I believe I am on the right path because the following line of code DOES successfully change the header of the column:
$('#part-1_HDR').text('TEST');
Any help would be greatly appreciated!
2
Answers
I made this exemple. This may be work in your case.
The column headings are in the column metadata. So an approach could also be to adjust this metadata and refresh the grid (this won’t do a reload, only redrawing as per current state).
Example code: