I have a jquery DataTable that has a column whose data is 1 or 0. I, by means of the render method, change that value for an image as follows:
"columns": [
{data: 'codigo'},
{data: 'tipolote' },
{data: 'activo', width: '10', className: 'text-center',
'render' : function(data, type, row) {
return (data == 1) ? '<span class="glyphicon glyphicon-ok"></span>' : '<span class="glyphicon glyphicon-remove" value="0"></span>';
}},
...
]
The drawback is that when I write something in the search textbox of the DataTable, an error is generated. If I remove the Active column, the search is done correctly filtering what corresponds. I understand that, when I remove the value 1 or 0 and put an image, I just lose the value and can not do the search. Is there any way to correct this problem?