【问题标题】:Oracle APEX 5.1.1 Hiding toolbar Actions buttonOracle APEX 5.1.1 隐藏工具栏操作按钮
【发布时间】:2023-03-27 22:22:01
【问题描述】:

我需要编辑我的 IG,但客户不想看到“操作”按钮。我一直在尝试使用 CSS(基于 StackOverflow 文章 here)和基于 John Snyders Hacking the IG 文章和博客文章 here 的 javascript 来隐藏 Actions 按钮的各种方法,但都没有成功。

我使用的 CSS 代码是

#load_sheet button[id="load_sheet_ig_actions_button"] {
  display: none !important
}

其中 #load_sheet 是 IG 区域的 static_id 名称。我正在使用按钮 ID,因为没有可用的数据操作,如上文所述。

我还尝试在 IG 高级属性中放置以下 javascript 代码:

function(config) {
  var $ = apex.jQuery;
  var toolbarData = $.apex.interactiveGrid.copyDefaultToolbar();
  config.toolbarData = toolbarData;
  // toolbarData[3] is the actions1 (Action button) array
  toolbarData[3]['hide'] = true;
  return config;
}

有没有办法隐藏“操作”按钮同时仍显示“编辑”和“保存”按钮?

感谢您的任何帮助或想法。

【问题讨论】:

  • #load_sheet_toolbar_actions_button { 显示:无!重要;您需要将该代码放在“css inline”字段中的页面属性中。你的 css 也应该可以工作,但只有这个是必要的。
  • 但是最好使用 javascript 来配置你的 IG,因为使用 css 你将你的 CSS 链接到那个选择器,如果它改变你的 css 它也必须改变......
  • 我同意 - 我更喜欢使用 javascript,但我认为我使用的方法是不够的;我猜动作按钮没有“隐藏”属性。任何替代品将不胜感激。

标签: oracle-apex oracle-apex-5.1


【解决方案1】:

也许有一个属性可以将该按钮设置为不可见,但我找不到。

但是,toolbarData 是一个数组,所以你可以从这个数组中移除那个按钮,在这种情况下那个按钮不会被渲染,你的代码应该是这样的:

function(config) {    
    var $ = apex.jQuery;
    var toolbarData = $.apex.interactiveGrid.copyDefaultToolbar();
    toolbarData.splice(3,1); //remove actions button
    config.toolbarData = toolbarData;

    return config;
}

【讨论】:

    【解决方案2】:

    我刚刚遇到了这个问题。抱歉回复晚了。

    这对我来说很好用:

    #eng_req_ig_toolbar_actions_button {
        display: none !important;
    }
    

    eng_req 是 IG 区域的 static_id 名称。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多