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

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

问题描述

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

进行研究时,我偶然发现了如何hack APEX交互式网格系列,以使用Java脚本自定义IG.因此,设置与 PL/SQL APEX_IR.ADD_FILTER过程,您可以在其中为交互式报表(IR)设置过滤器的列名,运算符和过滤器值 应该是可能的.

我想出了内部表的名称,如果设置了过滤器,则将它们存储在内部表中(IR过滤器为APEX_APPLICATION_PAGE_IR_COND,IG过滤器为APEX_APPL_PAGE_IG_RPT_FILTERS),但真的不知道这是否有用.

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

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

有人知道该怎么做吗?

解决方案

我刚刚解决了我的问题.在libaries\apex\widget.interactiveGrid.js中有一个称为addFilter的方法,可以使用过滤器对象和选项对象作为参数来简单地调用它. 当与其他输入字段的值结合使用时,这真的很有用.

示例:

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

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

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

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.

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.

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)

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

Does anyone know how to do this?

解决方案

I just solved my problem. There is an Method called addFilter inside the libaries\apex\widget.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.

Example:

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

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天全站免登陆