#Using Step Form with Livewire

3 messages · Page 1 of 1 (latest)

north crow
#

I am using Step Form on Action to Build 3 Step Form.
I am using Livewire table in Step. In the Table every row has checkbox to select rows.
I need help On final Submit How do I get back the rows value which are checked? Any idea?
My Resource File.

 Step::make('Select Channels')
                        ->schema([
                            Forms\Components\View::make('livewire-channel-table')
                            ]),
                            
                    Step::make('Select Videos')
                        ->schema([
                            Forms\Components\View::make('livewire-video-table')
                            ->viewData(['campaignId' => $record->id])
                        ]),

Livewire Blade file

 <tbody class="bg-white divide-y divide-gray-200">
            @foreach($channels as $channel)
                <tr>
                    <td class="px-6 py-4 whitespace-nowrap">
                        <input type="checkbox"   wire:model="checkedItems.{{ $channel->id }}" wire:change="handleCheckboxChange($event.target.value)"  name="selectedRows[]" value="{{ $channel->id }}">
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap">
                        {{ $channel->name }}
                    </td>
ripe mothBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

hybrid cedar
#

I'm not sure you can tbh, with a table it's completely out of scope. My only thought is to store the table values in the session on a bulkaction event and on submit, get the stored values? Or maybe you can get the table selected records for each element in the form?