LaCoder's avatar

Reload or refresh Livewire Powergrid

Hello,

I am submitting one form via Livewire submit and then I need to refresh a table(Powergrid Livewire).

in blade view, below is component for dataTable.

            <div class="table-responsive">
                <livewire:broker.brokers-api-data-table />
            </div>

Now when I submit a form, it goes to another component, AddBrokerModal and below is submit action when submit is clicked,

    public function submit()
    {
        $this->validate();
        DB::transaction(function () {
            $data = [
                'user_id' => auth()->user()->id,
                'brokerlist_id' => $this->brokerlist_id,
            ];

        BrokerApi::create($data);

        // Emit a successful event with a message
        $this->dispatch('success', __('New broker created'))->to(BrokersApiDataTable::class);
    
        $this->reset();
        });

    }

Now, I want to refresh brokers-api-data-table component when this form is submitted and successful dispatch occurs.

How to achieve that?

0 likes
0 replies

Please or to participate in this conversation.