laravel-livewire-tables icon indicating copy to clipboard operation
laravel-livewire-tables copied to clipboard

Individual column search is not refreshing/clearing the table

Open grafxflow opened this issue 1 year ago • 1 comments

I am using the following code for an Individual column search, but when I press the 'x' button it only clears the input not the table - the table still only shows the search result.

Column::make('Email', 'email')
    ->sortable()
    ->searchable()
    ->secondaryHeader(function() {
     return view('tables.cells.input-search', ['field' => 'email', 'columnSearch' => $this->columnSearch]);
}),

views/tables/cells/input-search.blade.php

@if (config('livewire-tables.theme') === 'tailwind')
    <div class="flex rounded-md shadow-sm">
        <input
            wire:model.debounce="columnSearch.{{ $field }}"
            placeholder="Search {{ ucfirst($field) }}"
            type="text"
            class="bg-white text-sm text-primary border-primary dark:border-primary rounded-md shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 form-input block mt-1 w-full @if (isset($columnSearch[$field]) && strlen($columnSearch[$field])) rounded-none rounded-l-md focus:ring-0 focus:border-gray-300 @else focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md @endif"
        />

        @if (isset($columnSearch[$field]) && strlen($columnSearch[$field]))
            <span wire:click="$set('columnSearch.{{ $field }}', null)" class="inline-flex items-center px-3 text-gray-500 border border-l-0 border-gray-300 cursor-pointer bg-gray-50 rounded-r-md sm:text-sm dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600">
                <i class="fa-solid fa-xmark"></i>
            </span>
        @endif
    </div>
@endif

grafxflow avatar Jul 16 '22 12:07 grafxflow

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 15 '22 15:08 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 30 '22 05:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 07 '22 01:11 stale[bot]