Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Duplicating filters when adding filter to interactive grid programmatically

dstinskiJan 20 2020 — edited Apr 17 2020

I think I may have come across a bug.

Here is my scenario:

I have 3 fields that I want to programmatically add filters to on an interactive grid: Customer, Plant, Sales Rep

The 3 fields are submitted via modal dialog to hidden page items on the page the modal branches to on submit.

pastedImage_0.png

I have a dynamic action that executes on page load with the following javascript code:

var filterArray = apex.region("pm_sales_forecast").widget().interactiveGrid("getFilters");

for(var i=0; i < filterArray.length; i++)

{

apex.region("pm\_sales\_forecast").widget().interactiveGrid("deleteFilter",filterArray\[i\].id);

}

if($v('P1_CUSTOMER') != '')

{

apex.region("pm\_sales\_forecast").widget().interactiveGrid("addFilter", { type: 'column', columnType: 'column', columnName: 'CUSTOMER', operator: 'EQ', value: $v('P1\_CUSTOMER'), isCaseSensitive: false});

}

if($v('P1_PLANT') != '')

{

apex.region("pm\_sales\_forecast").widget().interactiveGrid("addFilter", { type: 'column', columnType: 'column', columnName: 'PLANT', operator: 'EQ', value: $v('P1\_PLANT'), isCaseSensitive: false});

}

if($v('P1_SALES_REP') != '')

{

apex.region("pm\_sales\_forecast").widget().interactiveGrid("addFilter", { type: 'column', columnType: 'column', columnName: 'SALES\_REP', operator: 'EQ', value: $v('P1\_SALES\_REP'), isCaseSensitive: false});

}

For some reason filters are getting duplicated and I cannot understand why it is behaving this way. Please see results of the above code execution below:

pastedImage_4.png

Any ideas on why this is happening?

Comments
Post Details
Added on Jan 20 2020
3 comments
841 views