-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Table search not working with onSearchTextChanged #5444
Comments
@WillemJann can you tell us which datasource are you working with? Did you configure the datasource to filter data based on the {{ Table1.searchText }} field? |
The datasource of the table is a MongoDB query. The datasource is not configured to filter on the {{ Table1.searchText }} field. That's on purpose, because the default search behavior is in all visible columns of the table, which is very useful. |
@WillemJann You can write the logic as {{ Table1.searchText === undefined ? {} : { name: Table1.searchText } }} |
Before a while we have actually made this change in #4039. When we set/bind |
Ah, I see that this behavior is introduced after #4039. However, in previous versions of Appsmith we could benefit of the client-side search and additional actions. We use it to remember the search text, with an additional action it is saved in the store. The next time the default search text is read from the store, so that the same filtered table appears. Client-side search is easier because we don't need to modify all queries to take the searchText into account. Is there no way to combine the client side search with additional actions via the I started this issue as a bug because it was working in a previous version of Appsmith 😉 |
@Nikhil-Nandagopal I think what they need if to save the search text in the store and reference it the next time but let the client side handle the filtering process. @WillemJann Am I getting this right? |
Yes, that's exactly right. |
@vicky-primathon do you think this is achievable? |
@WillemJann thank you for the details. @somangshu yeah we can have a separate property to disable client-side search. |
@Nikhil-Nandagopal How do we handle disabled client-side search and no onSearchTextChanged action then. It would look like a bug to the end user. There could be other complexity as well here. |
@somangshu sounds like a bug the developer introduced so maybe we shouldn't be the ones to handle that? We can also provide explicit options for client side search such as case sensitive, insensitive, prefix match, fuzzy match and disable. |
@Nikhil-Nandagopal going by the first logic and ignoring that we allowed such a use case should work fine. Shall we implement this, It not a lot of effort and can be picked up soon |
Any update on this? Client-side search is still not working if |
@WillemJann this is not prioritised yet, I will pick this up soon. Dev Note:
|
I have the exact same use case and am running into the exact same issue after not having updated Appsmith for a while, suddenly the logic of remembering the table filter and doing client-side search is broken. |
@zegerhoogeboom can you explain the issue you're seeing with remembering the table filter? |
Hi @Nikhil-Nandagopal sure, the issue is exactly like @WillemJann described earlier in this issue. In this image there is an action When no What I want to happen, similar to @WillemJann is that client-side search is still done and the |
@zegerhoogeboom this is indeed exactly the issue. When this is solved we can remember the search text of tables and make client-side search happen. Thanks for your explanation! |
Description
For the table widget, if the
onSearchTextChanged
action is defined the actual search functionality is not working anymore. TheonSearchTextChanged
action itself is executed, but the search (filter) on the table is not applied.Steps to reproduce the behaviour:
onSearchTextChanged
to some action (e.g. save the search value in the store or show a message)onSearchTextChanged
action.Important Details
The text was updated successfully, but these errors were encountered: