Search code examples
google-app-maker

Appmaker Reloading datasource on onInputChange event issue


I have a table with a search bar above it. The content of the search bar filters the query for the table. I want the data in the table to be reloaded each time the user inputs a letter.

If I set the onValueEdit event to Reload the Datasource, it reloads the data just right, but if I set the onInputChange event to do the reloading, it reloads the table without filtering the query, displaying all of the records. No matter what I type in, it does not filter at all (altough it does seem to reload the datasource), unless I hit enter, fireing the onValueEdit event, when it does the filtering. Any ideas why can't I filter the query with the onInputChange event?

Thank you in advance!


Solution

  • The onInputChange event does not appear to support the value binding of a particular widget. Whether this is a bug or the intended behavior is unknown. There are two options to circumvent this behavior however and they are as follows:

    Change your code in the onInputChange event to:

    Option 1:

    widget.value = widget.value;
    widget.datasource.load();
    

    Option 2:

    widget.value = event.target.value;
    widget.datasource.load();