Small enhancement to site demos: sort by hidden title numeric allowing negative values

Small enhancement to site demos: sort by hidden title numeric allowing negative values

SyBorgSyBorg Posts: 3Questions: 0Answers: 0
edited June 2010 in General
Hello,

I've been playing with this great tool in the last week to integrate sortable tables in a intranet site, and I sort of solved a small problem with the demo code.

The function that allows to sort by "hidden title numeric"

[code]var x = a.match(/title="*([0-9]+)/)[1];[/code]

(and all its relatives in the same page) should be changed into:

[code]var x = a.match(/title="*(-?[0-9]+)/)[1];[/code]

(note the '-?' prepended in the regexp) to allow proper sorting with negative values.


Let's get into less (???) serious stuff:

My compliments for this great and precious tool!
I discovered the JQuery family last week and I'm really amazed with the results I could get! I ignored HTML/Javascript/AJAX developing for a long time, but a skype friend recently told me "why don't you check jquery"... well after that my has really changed (NO, I'm not talking about prosthetics/blue pills/fat burning miracles)

Replies

  • allanallan Posts: 63,205Questions: 1Answers: 10,415 Site admin
    Hi SyBorg,

    Thanks for the suggestion - a very good one :-). I've just updated the hidden title sorting plug-in now: http://datatables.net/plug-ins/sorting#hidden_title

    Thanks also for your compliments about DataTables. It's really great to hear that people such as yourself are enjoying using it and finding it useful!

    Regards,
    Allan
This discussion has been closed.