I'd like to get a summary component for a table that changes in real time depending on the displayed data on the table, so that when the user sets a filter, the data will reflect the filter, and when the filter is removed, the data will change.
I believe you could use a Transformer to return {{ yourTableName.getDisplayedData() }}
and use the resulting value in the summary component.
I get an error
TypeError: maintable.getDisplayedData is not a function
It appears this won't work within a Transformer. You can use this maintable.getDisplayedData()
directly in a Javascript query, but you will need to trigger that when a filter is set on the table.
how can i do so?
Like this:
I added a 2.5 second debounce because the opening of the table filter, the selection of the column to filter, the selection of the operator for the condition, and the input of the conditional value will all trigger the JS Query using the getDisplayedData()
function.
The return of the query can then be used to build the summary component of the relevant table data. You should see it update any time the filter is adjusted (though it may refresh with the same data at first). The debounce should help prevent too many runs but you may want to toy around with the best timing for your users.