Cannot make column.search work on td's with HTML in it

Cannot make column.search work on td's with HTML in it

errjeyerrjey Posts: 3Questions: 1Answers: 0

Link to test case: http://live.datatables.net/sopevego/1/edit
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
I cannot make colum.search work on columns with select or input inside the TD. On the select colums, the search item is also a select.

I tried different approaches, but unsuccessful.

Can anyone bring me some ligh on this?

Thanks in advance.

Answers

  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    It was just your libraries - you weren't including the correct ones so there were errors in your console: http://live.datatables.net/sopevego/4/edit

    The download page is always a good resource as it takes care of the libraries and their dependencies,

    Colin

  • errjeyerrjey Posts: 3Questions: 1Answers: 0

    Thank you for your help colin. But I still can't make "search" work when using an "option" object as a search selector and having "option" objects inside the td on the column.

    Is there any code example showing how to solve this? I tried with regex, normal search, even using the full html string inside the td.

    I know the uploaded code doesn't work straight away, I uploaded it to show how the code look like, to let u see if I was in the right direction or not.

  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    You were in the right direction, but yep, please post a test case demonstrating the issue you want help with,

    Colin

  • errjeyerrjey Posts: 3Questions: 1Answers: 0

    Hello Colin,

    I prepared a new code to show what I cannot accomplish:

    http://live.datatables.net/kezibixe/1/edit

    Here I'm using an example u posted:
    https://datatables.net/forums/discussion/68189/searching-option-selected-in-a-datatable

    But I'm unable to make search work on '<select>' column Office'. What I am doing wrong there?

    Thanks in advance.

  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    To do that, you would need to create a custom search. Here is the documentation, and here are a few examples. You would need to get the $(val) of the select element, rather than the element itself,

    Cheers,

    Colin

Sign In or Register to comment.