ramonrietdijk / livewire-tables Goto Github PK
View Code? Open in Web Editor NEWDynamic tables for models with Laravel Livewire
Home Page: https://livewire-tables.ramonrietdijk.nl/
License: MIT License
Dynamic tables for models with Laravel Livewire
Home Page: https://livewire-tables.ramonrietdijk.nl/
License: MIT License
Hey there,
Is there a way to hide columns by default?
Scenario: define columns but decide to hide some of them in the default display view, which the use can unhide through the table options.
Also: is there a way to persist column status per session, or in browser localstorage, so that when they refresh the page or browse away and come back they can find their column selections as is, not being reset to the original state. Is this something possible, or planned?
Being able to select multiple rows is a great feature to have but could be improved upon.
Sometimes selecting rows is not needed at all and would be great if it could be turned off as simply as Reordering. If there is nothing for a user to do when the rows are selected, then it can be confusing to users as to why they can select them in the first place.
Also, if it is enabled, there are times where you might want to specify the number of rows that are allowed to be selected. Having a property that specifies the maximum number of rows would be great to have.
You're on a roll, so I thought I throw this out there. This is such a big ask, that I am not even requesting the feature, merely putting it out there into the ether.
For Addable, I am envisioning a button in the bar
that would show when protected bool $addable = true;
. This button would show a modal that contains fields for all the Columns
and would have Add
and Cancel
buttons.
For Editable, I'm thinking having protected bool $editable = true;
show an edit icon in an actions column that would make each of the columns change into fields and the edit icon would change into a save button. Alternatively, it could show a modal like Addable.
For Deletable, it'd simply have protected bool $deleteable = true;
show a trash icon in the actions column that would have a confirmation before deleting the row.
I am thinking about working on this myself, but you've been so quick and elegant with the updates, I'd hate to waste time building it differently than you'd do it. :-)
It would be nice if there was a way to add a button (or an action to the action button) that would allow me to use JavaScript (specifically AlpineJS) instead of Livewire for the button's action.
The use case is for things like showing a modal. While this is easy to do in Livewire, sometimes you don't want to have to send a request to the server just to make something visible.
I put some thought into how to do it. I thought about making another trait for button
's or just making changes to the actions.blade.php
for standalone
actions. but I just couldn't wrap my head around how I'd handle passing the JavaScript to it. Perhaps it's too early in the morning. lol
This is a LOW priority request as I am able to just use Livewire for it.
Thank you for building this and considering the requests that are coming in.
Another suggestion: in addition to asHtml() implement a 'View Column' column type where one can pass the name of a blade file.
I'd like the ability to donate some money to help support this project. It might only be enough for a cup of coffee or a cool brew, but I'd like to show my appreciation for your work here. Perhaps you can turn on GitHub Sponsors.
Maybe build an export file feature, or can use third party assistance such as the Spatie package or other packages
Question: any plans to support other Eloquent Relations?
I'd love to help and support getting this implemented!
In the model property definition.
How can I limit the data being extracted based on a given condition.
For example I would like to do something like the following.
$model = Blog::where('year',2023)->get();
Would you be interested in adding slots to the table?
For instance, livewire-table::bar.bar
could have x-slot:before-actions
, x-slot:after-actions
, x-slot:before-search
, x-slot:after-search
, etc. This would allow for customization without having to publish the templates.
Action::make(__('My Action'), 'my_action', function (Enumerable $models): void { // }),
Excuse me, how to pass selected rows into this Enumerable $models
when declaring an Action?
Would be very nice if re-rodering, possibly using Livewire Sortable.js, was possible .
Hey Ramon,
Thanks for the awesome package, I like the simplicity and low overhead of this package.
I was wondering if you can explain some of the differences between this package and the other Livewire datatables, and maybe the motivations behind building yet another package for the same purpose. That might help developers relate, and make their minds to choose this one instead. Would love to hear your perspective :)
I want to create a table that has a base dataset of all the child records of the specific model that is loaded via Model-Route binding. I don't see a way to do this. Perhaps I am overlooking something.
For example, a phone with the id
of 32 has multiple accounts (lines) configured to it. When the user views the phone's configuration (/phone/32), I want to show a table of all the accounts associated with that specific phone and no others.
Any ideas on how I can accomplish this?
Hello ,
how can i style or set row class based on some conditions?
Hey there,
Is there a way to pass arbitrary data to views, something like:
ViewColumn::make(trans('lang.var'), 'namespace::view', ['variable' => 'Some Value']),
And inside namespace::view
I use it like $variable?
โ If this is something not currently supported, are you open to add this feature?
๐ก Why this is useful: Passing arbitrary data to views, enhances the flexibility and promotes reusability of view components. This practice allows developers to inject dynamic data into views, facilitating the creation of more interactive, customized content without hard-coding values. It fosters a modular approach, where components can be customized on-the-fly based on different contexts or user interactions, promoting a cleaner, more maintainable codebase.
https://datatables.net/examples/advanced_init/row_grouping.html
https://datatables.net/examples/server_side/row_details.html
Any plans to add support for these two features?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.