Giter Site home page Giter Site logo

Comments (3)

lordnaz avatar lordnaz commented on August 10, 2024 2

Hi, Thanks for your kind response. By the way, I just found another solution for this, but it will not be using the pre-made component and traits u made from this project. But it's a pretty (direct solution) with few customization and a little help of few CDN and jQuery. Just want to share this here if someone later, can find this useful as an option for using datatables in this project.

CSS :

https://cdnjs.cloudflare.com/ajax/libs/datatables.net-bs4/1.1.0/dataTables.bootstrap4.css
https://cdnjs.cloudflare.com/ajax/libs/datatables.net-select-bs4/1.3.3/select.bootstrap4.css

JS :

https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js
https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js
https://cdn.datatables.net/select/1.3.1/js/select.bootstrap4.min.js

UserController.php :

image

dashboard.blade.php

image

dashboard-table.blade.php

image

Outcome :

image

from laravel-8-stisla-jetstream.

nyancodeid avatar nyancodeid commented on August 10, 2024 1

Thank you, and good question. I never try this solution before, but it still make sense i think. So if you made a HTTP API request inside of Laravel / Livewire Component you can place it on app\Http\Livewire\Table\Main.php. But we have another problem, to use Livewire\WithPagination we must have data with typeof Illuminate\Pagination\Paginator from Laravel. I think, you need to convert your HTTP API response to Paginator first before Livewire can use it.

And i also consider if you mean is to make a request from the client side. You can call an API first from Javascript and passed it into Livewire component using @this.emit or @this.call methods and process it on Livewire Component. And again you must convert data response into Paginator first.

References:

from laravel-8-stisla-jetstream.

nyancodeid avatar nyancodeid commented on August 10, 2024 1

Wow, It's look awesome. Thanks for sharing the solution to us. I will leave this issue/question open for now, just in case someone have similar case like you. Good job @lordnaz, appreciate it.

from laravel-8-stisla-jetstream.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.