We’ve been using the trial version for a few days, trying to update our filters and tables to flexmonster’s and one of the requests of my employer is to filter data through the table columns from an empty table.
With an empty table, we would like to click each column and send a GET request to our API with the selected column as parameter and receive the possible filters for that column, without bringing all the data.
We would like to populate the filter list with the response and, after the desirable filter options are selected, a request is sent when the user clicks the “Apply” button on the filter modal and the table data is retrieved with the selected filters.
I was able to make the request to the server when opening the column filter, but by using the method setFilter() for that column, the filter modal is closed and I get an error informing that those members do not exist because they are not loaded as table data.
After the response with table data is obtained, we would load the table with pagination and each subsequent filter is applied the same way.
We would be grateful if you could tell us if this is possible to achieve and any assistance on how we can accomplish it would be greatly appreciated.
Thank you for contacting us.
If we understand correctly, your requirement is to apply filtering before loading the data to the component for the first time. In case our assumption is correct, please see the following explanation.
Currently, built-in UI controls do not allow pre-filtering.
However, we have come up with a workaround that may work for you.
It implies developing a custom Field List that would allow the required functionality.
You are welcome to see the sample implementation of this approach by the link: https://jsfiddle.net/flexmonster/7qazjk6s/.
A detailed explanation of the approach can be found below.
On the initial load, retrieve all the fields using the getAllHierarchies API call.
Having the enumeration of all fields, it is possible to compose and display the custom Field List.
After the user choose what field needs to be used for filtering, execute the getMembers method to receive the list of members for this field. Use this information to configure the corresponding filtering UI controls. Complement the filtering view with a label filter if needed.
To summarize, the process will look like this:
getAllHierarchiesmethod and receive the list of all hierarchies.
Please let us know if it works for you.
Our team is looking forward to hearing from you.
Hello, Illia. Thank you, that was incredibly helpful.