Search removes classes when going back to original table
Search removes classes when going back to original table
williamjameson
Posts: 2Questions: 1Answers: 0
tds with <i> classes such as:
<td><i class="fa fa-arrow-up></i>Value</td>
will have the i class removed when a search returns to the entire table. Is this a known error?
This discussion has been closed.
Answers
I'm guessing that because you say it's removed upon a search, that you are somehow adding the icon after dataTables obtains it's data object memory. So your icon is purely in HTML and not in the dataTable memory. When dataTable redraws, it fetches from memory, not HTML.
Can you paste how your are introducing the icons? That would help.
Yes that is what I'm doing. I am adding icons based on server data after the datatable is constructed. I did this out of convenience on my end. I can probably construct the table with the icons, but do not really want to
Is there a work-around for dynamically adding/removing icons or do you have to do this in the initial construction?
I would perhaps suggest using
columns.render
to render the cell information you need. See also the rendering documentation.Allan