Strip HTML and then sort numerically

Strip HTML and then sort numerically

ZerxerZerxer Posts: 13Questions: 0Answers: 0
edited January 2010 in General
Hello, I have a column of IDs that also have a checkbox in it with the ID wrapped around a label associated with the checkbox. I have sType on that column set to 'html' so it strips the HTML, but it seems it's then sorting the column as a string type rather than numeric type after it strips the HTML. Is this a bug or intended, and how would I go about having sType be html:numeric?

Thanks.

Replies

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Hi Zerxer,

    Use this plug-in: http://datatables.net/plug-ins/sorting#numbers_html

    Also you might be interested in this example if you are doing sorting with checkboxes: http://datatables.net/examples/api/dom_sort.html

    Regards,
    Allan
  • ZerxerZerxer Posts: 13Questions: 0Answers: 0
    Thanks.

    And nope, not sorting with checkboxes; they're there for something else. But that's pretty cool. DataTables is incredibly useful.
This discussion has been closed.