KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Ajax loading in Multi Select filter #2163

Open Chris Sideris opened this topic on on Jun 25, 2021 - 5 comments

Chris Sideris commented on Jun 25, 2021

Hi,

I am working on a Koolreport that has 2 Multi-Select filters and second filter needs to be updated based on the first filters selected values. I have tried replicating the example listed here https://koolreport.com/examples/reports/others/subreport_demo/ But seems like the example is only working for single select filter. Is there any way the same could be done for multiple selection?

Sebastian Morales commented on Jun 28, 2021

The example could work for multi select filter. Just remember that for a multi select filter its value ($this->params["myMultiSelect"]) is an array instead of a scalar value (like a string, a number, a date,..). Thus, if you want to filter using sql query you must use the operator IN instead of =. Or you could filter with our Filterprocess using the filter array.

Let us know if you have any difficulty or trouble implementing it. Tks,

Chris Sideris commented on Jun 28, 2021

I have tried doing it but it goes into an infinite loop where the change function keeps on getting called after the first select/deselect on the multi-select filter.

Sebastian Morales commented on Jun 29, 2021

It could be because your select is right inside the subreport that its change event makes that subreport updating, thus leading to loop. Pls copy our example with their exact structure of subreports, only add "multiple" => true for the select. If it still doesn't work pls post your code for us to check it for you. Rgds,

Chris Sideris commented on Jun 30, 2021

No it is still going to infinite loop even after copying the example

Sebastian Morales commented on Jul 1, 2021

Pls post your report and subreports code for us to check them for you. Tks,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None