ratiw / vue-table

data table simplify! -- vuetable is a Vue.js component that will automatically request (JSON) data from the server and display them nicely in html table with swappable/extensible pagination component.
MIT License
1.83k stars 303 forks source link

how to highlight rows' background data after loading data in callbacks #97

Closed elexea closed 7 years ago

elexea commented 7 years ago

{ name: 'expiryDate', sortField: 'expiryDate', callback: 'highlightExpired' },

highlightExpired: function (value) {
//highlight background color
                },

As titled, try highlight some particular rows if exceed expiry date

ratiw commented 7 years ago

@Elexea Use row-class-callback prop to specify method name to be used for highlight. Sample code here.

vuetable will pass the data for the current row to that method. You inspect the data to determine what CSS class to be used for that row.

elexea commented 7 years ago

@ratiw It is working now! Thanks for quick reply! Nice work