DataTables sorts cells containing only glyphicon

I have a column that is a pure glyphicon without text. I would like to make it sorted, now clicking sort does nothing.

I would like to keep it only with icons and without text, is there anyway, can I assign values ​​to sort?

HTML example for 1 cell:

<a href='#' class='toggleAdmin' data-id='123412341234' data-t='remove'><i class='glyphicon glyphicon-ok icon-success'></i></a>

enter image description here

+4
source share
1 answer

I'm not sure if this is the best way to do this, but I have added the following inside mine <i>:

<div style='display: none;'>1</div>

Sorting now works without compromising performance.

+4
source

All Articles