Update table from external form.

Very simple, I do not want to load the table until a form and new query is created. But is seems like $table->query() gets called way to early in the cycle. How can I modify the $table->query() when an outside form changes something that effects the query?
6 Replies
awcodes
awcodes3mo ago
Try ->modifyQueryUsing() to adjust the the tables query instead.
thedangler
thedangler3mo ago
Ok, I'll give it a shot. I have a custom form above my table and when the action button is applied in goes off and does some stuff to get information for the table which I try to pass with a new query. but never seems to work.
awcodes
awcodes3mo ago
Should just be a matter of emitting a $refresh to livewire. Assuming I’m understanding it all correctly.
thedangler
thedangler3mo ago
How do I emmit the refresh. When I press my button it doesn't work the first time, then when I press it again the table loads fine. I tried doing $this->resetTable(). Doesn't fix the issues wish I saw listeners in the table docs.
awcodes
awcodes3mo ago
It’s just livewire. It doesn’t have anything to do with tables. The page is the livewire component, not the table.
thedangler
thedangler3mo ago
refresh doesn't seem to work either. Still clicking the filter button twice to get it to work.