Custom Sort Algorithm?

Custom Sort Algorithm?

nrutmannrutman Posts: 1Questions: 0Answers: 0
edited September 2010 in General
Hey guys,

This should be either a quick "yes you can" or "no you can't" kind of question.

I'm looking for a way to specify my own sort algorithm. With other plugins similar to DataTables, it would be something where I could specify a function that would then return a numeric (?) value that's used to sort the content instead of the content itself.

This means that if you have meaningful data amidst other data (i.e. "Price: $150") you can use DOM scripting to extract the meaningful data (i.e. 150), or provide smart sorting (i.e. where values of "small" = 1, "medium" = 2, "large" = 3, etc.) that can be sorted easily.

I've scoured the documentation, but I find it a little overwhelming. Is there an easy way to accomplish this?

Thanks,
-Nate

Replies

  • spydinkspydink Posts: 4Questions: 0Answers: 0
    Yes you can! See the examples here:

    http://www.datatables.net/plug-ins/sorting

    It looks like the "Priority" example may best match your need.

    Matthew
  • RookiedevRookiedev Posts: 1Questions: 0Answers: 0

    Thanks, works for me

This discussion has been closed.