I followed this example: http://www.datatables.net/development/filtering
But it's not working. If you input 'a' as search keyboard, all rows are still shown in the table because it searches the html tag <a>. What am I missing?
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
<script>
$.fn.dataTableExt.ofnSearch['string'] = function ( sData )
{
return sData.replace(/\n/g," ").replace( /<.*?>/g, "" );
};
$(document).ready
(
function()
{
$('#search').dataTable
(
{
aoColumns:[
{'sType': 'string'}
]
}
);
}
);
</script>
</head>
<body>
<table id="search">
<thead>
<tr>
<th>search</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="www.google.com">b</a></td>
</tr>
<tr>
<td><a href="www.google.com">c</a></td>
</tr>
<tr>
<td><a href="www.google.com">d</a></td>
</tr>
<tr>
<td><a href="www.google.com">e</a></td>
</tr>
<tr>
<td><a href="www.google.com">f</a></td>
</tr>
<tr>
<td><a href="www.google.com">g</a></td>
</tr>
</tbody>
</table>
</body>
</html>