How to use individual column searching with span and hyperlink attributes
How to use individual column searching with span and hyperlink attributes
feeder
Posts: 8Questions: 3Answers: 0
Hi,
I need to use column searching in my table.
It's not working when I have some tags (<span><a>mytextw</a></span>) in my cell.
Does someone have an idea ?
Here this an exemple (the serach it's not working maybe due to keypress function on http://live.datatables.net)
Thanks in advance
This discussion has been closed.
Answers
Hello,
I took a look on your example, and found out the issue. There are actually two problems:
$('.filtertable').on.keypress(function(event) {
should be$('.filtertable').on('keypress', function(event) {
(line 490)$('#referenceTable').DataTable()
should be$('#example').DataTable()
(line 495)You're right, thanks. Here is the good DataTable. The search on the first column with the span and hyperlink is working on http://live.datatables.net, but in my server the search return nothing. I was thinking about an issue due to <span> and <a> tags. Does someone have an idea ?
I noticed that on your newest example the render function is slightly wrong. It sort of opens the 'a' tag twice. Other than that your example is working fine. It is worth mentioning that the search only happens when you press (ie, hold and release) the enter key (whose code equals 13).
Are you sure you're reproducing the issue? You did mention a server, but all I see is client side precessing.
It's ok. I put a bad index in my th column, so the search was wrong...
Not my week...