Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork62
Ability to use static data (no server-side)#221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Hello@yajra , Could you please have a look at this and share me your feedback? Here I also added the basic usage of the datatable for the controller and the blade parts. class TestControllerextends Controller{publicfunctiontest() {$dataTable =newExampleStaticDataTable();returnview('test')->with(['dataTable' =>$dataTable->html(), ]); }} {!!$dataTable->table()!!}{!!$dataTable->scripts()!!} |
1190 commentedAug 10, 2024
hey@yajra, could you please review this? |
@OzanKurt this is a great feature, thanks for sending the PR. I will test this as soon as I can. One thing I noticed is that maybe we can simplify the syntax further by setting publicfunctionhtml():Builder {return$this ->builder() ->rows($this->buildRows()) -- callingthis will set serverSide to false ->serverSide(false); -- so we can removethis line } |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Arjay Angeles <aqangeles@gmail.com>
Automatically calling serverSide(false) makes so much sense! In addition to this I am currently working on the option to load the initial data from ajax while having I will send a new update in a couple days. |
Thanks for the updates, let me know if this is ready for review again. |
Uh oh!
There was an error while loading.Please reload this page.
I recently wanted to use the package for a "array based datatable".
Sadly when I do;
it doesn't generate the tables body.
I added some logic to the
Builder
class so that we can make it fill thetbody
IF theserverSide
option is disabled.Here is an example DataTable I've prepared along with 2 methods
makingRowExample
andmakingCellExample
explaining how theRow
andCell
classes apis work. I tried to make things similar to theColumn
class which we already.There area a couple important places I've marked via comments inside the code.