最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Oracle Apex 18.1 Interactive Grid (IG) Setting filters programmatically? Customizing IG Search - Stack Overflow

programmeradmin4浏览0评论

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?

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?

Share Improve this question asked Aug 5, 2018 at 18:07 fpulchfpulch 811 silver badge6 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

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 bined 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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论