aaSorting with column name instead of number?

aaSorting with column name instead of number?

archymarchym Posts: 2Questions: 0Answers: 0
edited June 2011 in General
Hi,

thank you for your great DataTables, I'm using it on my site and it works great.
I do have a request: would it be possible to use aaSorting with a column name instead of a column number? That would make it easier to use (for me).

Thanks!

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Hi archym,

    It's a good suggestion. I think it future it would be nice to be able to use column names and indexes interchangeably - DataTables can figure out which one is which. However that's probably 2.0 before I'll be able to integrate that in. For now what you could do is have a function which provides a look up - pass it a name and it will give you the column index - a plug-in API method would be ideal for this.

    Allan
  • archymarchym Posts: 2Questions: 0Answers: 0
    Thanks for considering it for 2.0. It's not a show stopper for me, would just make it more easy to use. I'll happily wait for 2.0 ;)
  • jamesjburtjamesjburt Posts: 8Questions: 0Answers: 0
    http://datatables.net/forums/discussion/79/column-name-instead-of-index-for-sortingfiltering.

    Look here
This discussion has been closed.