Happy-Coding-Clans / vue-easytable

A powerful data table based on vuejs. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.
https://happy-coding-clans.github.io/vue-easytable/
MIT License
3.69k stars 738 forks source link

Need custom data like links and images as well in fields #119

Closed ian-pinto-vamaship closed 6 years ago

ian-pinto-vamaship commented 6 years ago

Need custom data like links and images as well in fields

huangshuwei commented 6 years ago

you can look at this demo: http://doc.huangsw.com/vue-easytable/app.html#/table/customColumns

ian-pinto-vamaship commented 6 years ago

thanks huangshuwei for the prompt response, formatter function did the trick. For instance in my Logistics vue based app I used

formatter: function (rowData, index, pagingIndex) {
                return rowData.service === 'ocean' ? '<i class="fa fa-ship" />' : '<i class="fa fa-fighter-jet" />'
              }

to conditionally display a ship or plane icon for a specific service type (ocean/air)