Is there a way to hide some Functions/Operators in the Row Filter of APEX 19.1's Interactive Report? Some end-users get confused with as many functions/operators that they do not used.
Thanks for any considerations.
Is there a way to hide some Functions/Operators in the Row Filter of APEX 19.1's Interactive Report? Some end-users get confused with as many functions/operators that they do not used.
Thanks for any considerations.
虽然 APEX 不支持开箱即用,但它可以使用 JavaScript。每次显示过滤器对话框时,都会将内容从服务器带到客户端并注入 DOM。您只需要在用户看到之前修改内容。实现此目的的一种方法是使用 MutationObserver 接口:https ://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
以下是您可以执行的一些步骤(在 APEX 19.2 中测试):
转到页面级属性并将以下代码添加到函数和全局变量声明字段:
function removeIRFilterOperators() {
var irRegId = 'my-irr';
var filterOperatorsToRemove = ['!=', 'ABS'];
var observer;
function detectFilterDialog(mutationsList) {
for (var mIdx = 0; mIdx < mutationsList.length; mIdx++) {
if (mutationsList[mIdx].addedNodes.length &&
mutationsList[mIdx].addedNodes[0].classList &&
mutationsList[mIdx].addedNodes[0].classList.contains('a-IRR-dialog--filter')) {
removeOperators();
}
}
}
function removeOperators() {
var anchors = document.querySelectorAll('#' + irRegId + '_row_filter_operators a');
for (var aIdx = 0; aIdx < anchors.length; aIdx++) {
if (filterOperatorsToRemove.includes(anchors[aIdx].textContent)) {
anchors[aIdx].parentElement.parentElement.removeChild(anchors[aIdx].parentElement);
}
}
}
observer = new MutationObserver(detectFilterDialog);
observer.observe(
document,
{
attributes: false,
childList: true,
subtree: true
}
);
}
removeIRFilterOperators();
MutationObverver 使用该detectFilterDialog
函数来检测过滤器对话框何时添加到 DOM。发生这种情况时,该removeOperators
函数会从操作员列表中删除指定的选项。您需要做的就是更新filterOperatorsToRemove
数组以包含您要删除的运算符列表。
如果您在谈论“操作”菜单,那么可以 - 转到 IR 的属性并启用/禁用您想要的任何选项: