jQuery DataTables add country icons each column

北慕城南 提交于 2019-12-23 09:53:38

问题


I want to add in DataTables a country icon on each country column (with jQuery) which is the same as the text that is displayed on that column.

So when it contains the country US then there is a image before the text that will link to us.png.

So, from this:

to this:

(Edited in Chrome DevTools)

I think it can be done with aaData, but I don't know how to use that without replacing the whole column.

Somebody has an answer?


回答1:


Use the fnRowCallback.

Refer this example from the datatables documentation http://datatables.net/release-datatables/examples/advanced_init/row_callback.html



来源:https://stackoverflow.com/questions/16122924/jquery-datatables-add-country-icons-each-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!