Oracle Apex 18.1 交互式网格 (IG) 以编程方式设置过滤器?自定义 IG 搜索 [英] Oracle Apex 18.1 Interactive Grid (IG) Setting filters programmatically? Customizing IG Search

查看:43
本文介绍了Oracle Apex 18.1 交互式网格 (IG) 以编程方式设置过滤器?自定义 IG 搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过 Javascript 或 PL/SQL API 为 Oracle Apex 中的 IG 设置过滤器?

Is there a way to set filters for an IG in Oracle Apex via an Javascript or PL/SQL API?

在做研究时,我偶然发现了 适用于 5.1.4 的 APEX IG 食谱或一些博客文章 如何hack APEX 交互式网格系列,用于使用 Javascript 自定义 IG.所以设置过滤器类似于 PL/SQL APEX_IR.ADD_FILTER 程序,您可以在其中为交互式报告 (IR) 设置过滤器、列名、运算符和过滤器值应该是可以的.

Doing my research i stumbled across APEX IG Cookbook for 5.1.4 or some Blogposts How to hack APEX interactive grid series for customizing IGs with Javascript. So setting filters similar to the PL/SQL APEX_IR.ADD_FILTER Proceedure where you can set filters for an interactive Report (IR) the column name, operator and filter value should be possible.

我想出了内部表的名称,如果设置了过滤器,则存储过滤器的位置(APEX_APPLICATION_PAGE_IR_COND 用于 IR 过滤器,APEX_APPL_PAGE_IG_RPT_FILTERS 用于 IG),但不知道这是否有帮助.

I figured out the name of the internal tables, where the filters are stored if they're set (APEX_APPLICATION_PAGE_IR_COND for IR Filters and APEX_APPL_PAGE_IG_RPT_FILTERS for IG) but don't really know if that's helpful.

apex.region("StaticRegionID").widget().toolbar("findElement","search_field").val("SearchTextValue");apex.region("StaticRegionID").widget().interactiveGrid("getActions").invoke("search");可以设置搜索值并执行搜索操作,但不能设置运算符/过滤器类型(EQ、NEQ、LT、LTE、GT、GTE、LIKE、NLIKE、N、NN、C、NC、IN,NIN)

With apex.region("StaticRegionID").widget().toolbar("findElement","search_field").val("SearchTextValue"); apex.region("StaticRegionID").widget().interactiveGrid("getActions").invoke("search"); it is possible to set the Searchvalue and execute the search action but it isn't possible to set the operator/Filter type (EQ, NEQ, LT, LTE, GT,GTE, LIKE, NLIKE, N, NN, C, NC, IN, NIN)

到目前为止,我还没有找到在 libariesapexwidget.interactiveGrid.js 中自定义搜索操作的好方法,或者在调用搜索操作之前设置正确的参数以添加过滤器.

So far i haven't found a good way to customize the search action in libariesapexwidget.interactiveGrid.js or to set the right parameter before invoking the search action in order to add the filters.

有人知道怎么做吗?

推荐答案

我刚刚解决了我的问题.libariesapexwidget.interactiveGrid.js 中有一个名为 addFilter 的方法,可以简单地使用过滤器对象和选项对象作为参数调用.当与来自其他输入字段的值结合使用时,这非常有用.

I just solved my problem. There is an Method called addFilter inside the libariesapexwidget.interactiveGrid.js which can be simply called with a filter object and a options object as parameter. This is really useful when combined with the values from other Inputfields.

示例:

apex.region("YourStaticRegionID").widget().interactiveGrid("addFilter", {
  type: 'column',
  columnType: 'column',
  columnName: 'YourColumnName',
  operator: 'EQ',
  value: $v2('P2_NEW'),
  isCaseSensitive: false
});

$v2 API 在上面的示例中用于获取用户在名为 P2_NEW 的文本输入字段中键入的搜索词.

The $v2 API is used in the example above to get the search term the user typed in a Text Input Field called P2_NEW.

这篇关于Oracle Apex 18.1 交互式网格 (IG) 以编程方式设置过滤器?自定义 IG 搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆