Forcing a TableWidget to refresh its builder query.
Hey there!
I'm trying to figure out the best way to handle this:
I have a Resource with a form that has some filters, the filters apply to an unrelated model (i.e, not the Model associated with that form). Users can add/remove filters using a Repeater. I'd like to show them the results of applying the filters, so I decided to use a simple
ViewField
to load a "dynamic" TableWidget, basically it shows the data from the other model (it's super simple, just extending TableWidget). The blade for the viewfield looks like:
The table()
in the DynamicTableWidget
is:
When users update the filters on the main form, I'd like to pass a new builder (with those filters applied) to the table and force it to refresh.. any ideas?Solution:Jump to solution
Well, that was actually really easy: just dispatch an event from the form and add a listener in the TableWidget.
1 Reply
Solution
Well, that was actually really easy: just dispatch an event from the form and add a listener in the TableWidget.