Grid View filter from Text Input and Select

I'm trying to achieve the result like this website
I tried using this script but it doesn't work. Anyone has any idea how do this?

formatDataAsArray(gridView1.data).filter(x => x.rule_name.includes(textInput1.value))

Hi there @ducnta,

You're on the right track.

I would target the listview datasource, rather than triggering an event on the textinput event handler. Your current script is actually not setting a filter, but simple returning a set of data with a filter, but it isn't targeting your listview's data source (and there is no actual way of doing it, compared to setting a filterstack on a table).

Select your listview, and on your data source you can add the filter directly there (you can click on the FX button next to the data source to make it dynamic), e.g.

{{ formatDataAsArray(query1.data).filter (x => x.rule_name.inclues (textInput1.value)) }}

This will then filter the data at your listview's data source level (you could apply this at a query level as well, but that is a different approach)

One issue with the above approach is that the data will filter with each character being typed (although this wouldn't be different with your change event handler).

Hope this helps

1 Like

It works ! Thank you so much :heart_hands:

1 Like