Sorting Numbers that are Links

Sorting Numbers that are Links

whobutsbwhobutsb Posts: 15Questions: 0Answers: 0
edited July 2009 in General
Hello all,

I have a table which is mostly numbers that are hyperlinks. I'm looking to be able to sort the numbers, but I can't seem to use either "html" or "numeric" to sort the numbers. When I use "html" it will sort the numbers like: 9,8,5,17,11,1,0. And when I use numeric it won't sort at all. Is there a solution or a special way I should format the table numbers?

Thanks for the help,
Steve

Here is a sample of my table:

[code]

Sales ManagerCanceledProspectiveTentativeContract OutDefiniteActualizedTotal Events Referred

Gail Alofsin0000000


Nancy Andrade0000000

.[/code]

Replies

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

    What you can do is make use of the HTML numbers sorting plug-in function ( http://datatables.net/plug-ins#sorting_numbers_html ). You then just need to set the sType for your column to 'num-html'. See this example for adding plug-in functions: http://datatables.net/examples/example_sorting_plugin.html

    Regards,
    Allan
  • njrajunjraju Posts: 4Questions: 0Answers: 0
    Hi allan,
    After three days of hardwork came to know the usage of number html plugin.
    Y dont u guys provide the clear cut example....It will be really helpful........pls do that
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi njraju,

    The information above should provide you with everything that is needed for sorting numbers mixed with HTML. The plug-in to do it is there, and so is an example showing how this style of plug-in can be used. This is all available in the documentation on the site as well as this post.

    We do provide clear cut examples, where appropriate ( http://www.datatables.net/examples ), but can't and won't provide code for every circumstance. If you do want someone to write code for you, please feel free to hit the donate button above :-)

    Regards,
    Allan
This discussion has been closed.