@AdamVaclav
I tried this way, In filter component, i sent dispatch to LiveFutureDataTable powergrid table,
class LiveFutureFilter extends Component
{
public $selectedExpiry;
public $selectedSymbol;
public function resetSelectedExpiry()
{
$this->selectedExpiry = null;
}
public function updatedSelectedValues()
{
$this->dispatch('filterChanged', symbolSent: $this->selectedSymbol)->to(LiveFutureDataTable::class);
}
public function render()
{
return view('livewire.future.live-future-filter');
}
}
and in powergrid table, added listener...
public function filterC($symbolSent)
{
$this->symbol = $symbolSent;
dd($this->symbol);
}
protected function getListeners(): array
{
return array_merge(
parent::getListeners(),
[
'filterChanged' => 'filterC',
]);
}
But how to test if event is dispatch successful or not, as i dont know then i tried with dd but nothing happend.
When i sent via Button it sent out correctly, but it is not sending via component,
<button wire:click="$dispatchTo('future.live-future-data-table', 'filterChanged', { symbolSent: 'TEST' })">
EditPost
</button>
Below is via component, when select value change it goes to component and from there it dispatch to LiveFutureDataTable,
public function updatedSelectedValues()
{
$this->dispatch('filterChanged', symbolSent: $this->selectedSymbol)->to(LiveFutureDataTable::class);
}