本文介绍了jQuery DataTables每列添加国家图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在,但我不知道如何使用它,而不用替换整列。
有人有答案?
解决方案
使用 fnRowCallback
。
从数据表文档
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:
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?
解决方案
Use the fnRowCallback
.
Refer this example from the datatables documentation http://datatables.net/release-datatables/examples/advanced_init/row_callback.html
这篇关于jQuery DataTables每列添加国家图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!