LowerRockLabs / LaravelLivewireTablesAdvancedFilters

Advanced filters for Rappasoft Laravel Livewire Tables
8 stars 0 forks source link

[PROPOSITION NEW FEATURE] Select2 with data list obtained via AJAX #80

Open shawe opened 3 months ago

shawe commented 3 months ago

This is not an issue of an error.

May it be possible to implement filters that are populated via AJAX, as documented for Select2, so that large amounts of data can be used, but without negatively affecting the user experience?

I have some working on editing small forms, and I think this way would be good for certain cases where some filters could have a lot of data but its populated on demand when needed.

I can share this with you, or colaborate with your repo to add this support if you are interested.

I do it this way to have an initial support outside laravel livewire tables, and seems to be responsiveness. But not in laravel liverwire tables, an looking for a possible existing filter found your repo, and I think that could be a good extra for your advanced filters. But maybe not implement as I'm sharing with you to can have any usable samples.

For example:

Route::get('users/json/{search?}', [UserController::class, 'json'])->name('admin.users.json');

@once @push('css')

    <link rel="stylesheet"
          href="{{ asset('build/extensions/select2-bootstrap-5-theme/select2-bootstrap-5-theme.min.css') }}">
@endpush

@push('js')
    <script src="{{ asset('build/extensions/select2/js/select2.min.js') }}"></script>
    @if (file_exists(public_path('build/extensions/select2/js/i18n/' . app()->getLocale() . '.js')))
        <script src="{{ asset('build/extensions/select2/js/i18n/' . app()->getLocale() . '.js') }}"></script>
    @endif
@endpush

@endonce

@push('js')

@endpush

shawe commented 3 months ago

If you can share with me some guidelines, I can try to implemented it more clean to your repo.