Searching in Ginkelsoft DataTables

Overview

Ginkelsoft DataTables includes built-in searching capabilities that allow users to dynamically filter table data in real time. Searching is always enabled by default and cannot be disabled.

How Searching Works

Search Input: A search field is provided at the top of the table.
Livewire Binding: Searching is implemented using Livewire’s debounce feature, which updates the results as the user types.
Multi-Column Search: The search applies across all visible columns unless overridden.

Search Behavior

The search matches all columns that are defined in :columns. It performs a case-insensitive 'LIKE' search in the database.
Searching affects all paginated results, ensuring accurate filtering across pages. The search term resets when the table is refreshed.

Example Usage

<livewire:datatable
    model="App\Models\User"
    :columns="['id', 'name', 'email', 'created_at']"
    :filters="[
        ['column' => 'name', 'type' => 'input', 'label' => 'Naam'],
        ['column' => 'email', 'type' => 'input', 'label' => 'Email']
    ]"
/>

Customizing the Search

Currently, searching is always enabled. However, developers can:
Customize debounce time (e.g., debounce.750ms for a slower update rate).
Modify placeholder text via translations (datatable::datatables.search).
Override the search method inside the DataTableComponent class to implement a custom search logic.