-
Hi, I am following the tutorial on this page ( https://docs.budibase.com/docs/adding-a-search-field ) but essentially what I want is to do option 2, but instead of auto refresh when someone types on the fields, trigger the search only when a form button is clicked. How can I do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @0afcode If you have followed the steps in option 2, then this is fairly easy to do! Step 1 - Add your search buttonAdd a container and nest your search field within it. Next add a button. You can set the direction of the container to get the button to sit nicely beside the text field. Next Step 2 - Filtering on app stateWe can now use the App State that we have saved to filter on. Because the app state is only updated on the button click in this case, the filter will only trigger when the button is clicked. Click That's it! Result |
Beta Was this translation helpful? Give feedback.
Hey @0afcode
If you have followed the steps in option 2, then this is fairly easy to do!
Step 1 - Add your search button
Add a container and nest your search field within it. Next add a button. You can set the direction of the container to get the button to sit nicely beside the text field.
Next
Define actions
for your button. Add the Update State action, with a key and value bound to the search field:Step 2 - Filtering on app state
We can now use the App State that we have saved to filter on. Because the app state is only updated on the button click in this case, the filter will only trigger when the button is clicked.
Click
Define filters
on the Data provider of the table, and use th…