Comments (3)
If I understand your request, you should be able to do this by overriding the _columns.blade.php file.
Currently there is no way to publish the views from this package via an artisan command. However, I have submitted a pull request to make it possible.
Until the pull request is approved, you can manually copy everything in vendor/rappasoft/laravel-livewire-tables/resources/views/ to resources/views/vendor/laravel-livewire-tables/.
The file you'll want to edit is resources/views/vendor/laravel-livewire-tables/includes/_columns.blade.php
from laravel-livewire-tables.
Consider the column "primary" that is true or false. We might want to change the output to display something else instead of 0 and 1, an option that allows to display an icon, image or basicly a string that allow us to do just that. It will nice if we can include the original value in that string also, this will allow adding some icon or formating to the output text,
This can be done using the ->view()
method.
from laravel-livewire-tables.
Consider the column "primary" that is true or false. We might want to change the output to display something else instead of 0 and 1, an option that allows to display an icon, image or basicly a string that allow us to do just that. It will nice if we can include the original value in that string also, this will allow adding some icon or formating to the output text,
This can be done using the
->view()
method.
Can you elaborate on this a bit? How does the view know what the row data is?
Also how can we make it work for any attribute? E.g I have a time stamp and want a view that converts it into a certain date format, or money in cents that I want to display as a formatted string, and how do you maintain the flexibility of different attribute names. For example, say I want to format created_at
so I put that in the view. What about if I want to apply the same component to updated_at
now, or another custom date attribute name?
Currently to me it seems like I would have to make a separate view for each, and that approach doesn’t seem very flexible and seems far too opinionated for people who want to use this pkg in a bunch of different projects.
I mentioned in another issue I created that this could be made quite significantly better by allowing a callback on the Column::make function that allows you to access the row data and mutate it however you need before it’s displayed in the table.
from laravel-livewire-tables.
Related Issues (20)
- [Bug]: DateRangeFilter does not permit a single date HOT 2
- [Feature Request]: Possibility of overwrite default´s classes HOT 1
- [Bug]: Cannot use GroupBy or multiple GroupBy and multiple distinct in PostgresSql HOT 1
- [Bug]: In rappasoft/laravel-livewire-tables 2.9.0 showbulkactionsdropdownalpine issue HOT 1
- [Bug]: src attribute empty for ImageColumn column HOT 8
- [Bug]: setSearchDebounce(1000) has no effect HOT 7
- [Bug]: can not use cutom toolbar.blade.php HOT 5
- [Bug]: Cannot load css/js assets under a non-root URI HOT 2
- [Feature Request] ImageColumn - Conditional Rendering of IMG Tag HOT 2
- [Bug]: Loading placeholder not working HOT 2
- [Bug]: publishing assets not working HOT 2
- [Bug]: Uncaught ReferenceError: currentlyReorderingStatus is not defined HOT 4
- [Bug]: sortable() doesn't work when i use label HOT 4
- [Bug]: Trailing spaces get removed while typing in the search bar. HOT 1
- [Bug]: Livewire component in Datatable: Snapshot missing on Livewire component with id... HOT 3
- [Bug]: Artisan About: wrong version number HOT 2
- [Bug]: collapsing seems to be broken on table row because of the breakpoints that doesnt match with the one on table head HOT 5
- [Bug]: Search box and Column Per Page Dropdown can't read css style from tailwind HOT 1
- [Bug]: Per Page doesn't apply when returning to the table HOT 9
- [Bug]: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'user_id' in where clause is ambiguous HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-livewire-tables.