Sorting in HTML tags (Example included)

Sorting in HTML tags (Example included)

MalkinMalkin Posts: 2Questions: 0Answers: 0
edited January 2013 in Bug reports
Hey,

Cheers for the plugin, really helpful on report-y type internal sites with data all over.

I'm having a problem with sorting with HTML tags however. Please see rating column @ http://jsbin.com/usojat/6/

any pointers would be greatly appreciated, ta!

Replies

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    You want this plug-in: http://datatables.net/plug-ins/sorting#numbers_html :-)

    Allan
  • MalkinMalkin Posts: 2Questions: 0Answers: 0
    edited January 2013
    Hi allan,

    cheers for quick response mate, been checking out your projects too and you've done some cool stuff :)

    I've managed to get it working now with setting the sType. I had already included the sorting plugin but I believe it was the type detection plugin dragging it down, I'll post a JsBin with my example in a second.

    Was I wrong in presuming that I wouldn't need to declare the sType with the type detection html with numbers plugin?

    My only issue(hardly an issue aha) is that I sweepingly instantiated tables with a class, so I have had to manually instantiate two tables with html-nums in as the columns are all mismatched.

    Again, thank you for the great plugin, keep up the great work :)

    Jim

    EDIT: JSBin of working example, for anyone who might have a similar query http://jsbin.com/usojat/11/
  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    > Was I wrong in presuming that I wouldn't need to declare the sType with the type detection html with numbers plugin?

    No that should be the case. Type detection will automatically set the sType, so it sounds like there might be an issue in the plug-in there.

    Allan
  • HastoHasto Posts: 3Questions: 0Answers: 0
    edited April 2013
    Hi,
    Thank you very much for your work, it helped me to win a loft of time with all these extras and plugins.
    However i have the same problem, it worked when i defined the Stype but i would like to know if auto detection is solvable ?
    All my tables are autogenerating with SQL statement, and the order of the columns will change!
    This is the content of my td :

    XXX

    Moreover i will have column with html which are not number but date or currency etc... :S
    Thank you in advance.

    Clement
  • HastoHasto Posts: 3Questions: 0Answers: 0
    Up! Help please :S
  • HastoHasto Posts: 3Questions: 0Answers: 0
    Sorry, i solve my problem alone with the functions here :
    http://datatables.net/plug-ins/type-detection#functions
    + http://datatables.net/plug-ins/sorting
    I didn't see the first one!
    Thank you again for your work
This discussion has been closed.