How to use individual column searching with span and hyperlink attributes

How to use individual column searching with span and hyperlink attributes

feederfeeder Posts: 8Questions: 3Answers: 0
edited July 2018 in Free community support

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

Answers

  • lucaslmlucaslm Posts: 5Questions: 1Answers: 0
    edited July 2018

    Hello,

    I took a look on your example, and found out the issue. There are actually two problems:

    1. $('.filtertable').on.keypress(function(event) { should be $('.filtertable').on('keypress', function(event) { (line 490)
    2. $('#referenceTable').DataTable() should be $('#example').DataTable() (line 495)
  • feederfeeder Posts: 8Questions: 3Answers: 0

    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 ?

  • lucaslmlucaslm Posts: 5Questions: 1Answers: 0

    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.

  • feederfeeder Posts: 8Questions: 3Answers: 0

    It's ok. I put a bad index in my th column, so the search was wrong...
    Not my week...

This discussion has been closed.