type of columnDefs doesn't seem to work after v1.10.1

type of columnDefs doesn't seem to work after v1.10.1

katamarankatamaran Posts: 2Questions: 1Answers: 0

Link to test case:
This is an example of a column with HTML fields in two different versions. Search for "query 1" in both.

v1.12.1
https://jsfiddle.net/xe3uvs14/20/

v.1.10.1
https://jsfiddle.net/2qm1ynzc/1/

Description of problem:

The problem is that in the old version the html values and attributes are searchable, while that is not the case for newer versions. I think this issue has started from v.1.10.2.

Has something changed? Am I doing something wrong?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    The columns.type option shouldn't be used. I made a mistake allowing it to be configured. If DataTables can't autodetect your column type correctly, then forcing it to a specific value (html in this case) will not work either.

    Attributes and live DOM values shouldn't have been searchable in any version before. If that did work - it was by mistake!

    We do have live DOM sorting that would work with your input element, but filtering doesn't do that I'm afraid.

    Allan

  • katamarankatamaran Posts: 2Questions: 1Answers: 0

    Yes the live DOM sorting works as the example describes. But in order to answer exactly for the given example the working code is:

    $(document).ready(function() {
                var table = $('#example').DataTable( {
    
                    columns: [
                      { orderDataType: 'dom-text', type: 'string' },
                      null,
                      null
                  ],     
                } );
    } );
    

    Or here: https://jsfiddle.net/xe3uvs14/22/

    Thank you for the quick and easy to understand response.

Sign In or Register to comment.