How to create unsortable column?

How to create unsortable column?

pawelekgnopawelekgno Posts: 7Questions: 0Answers: 0
edited September 2010 in General
Hi.
Today I started in using DataTables. I think it's awesome tool, but I need one thing which I can't find anywhere. I need to make first column unsortable, must always starts on value 1.

Look here - http://pawelek.gniezno.pl/nastoliga/ (using DataTables example's css, because it's nice :D)
I'm selecting name, surname, 3-2-1-0's, counting points (pkt) and average of one heat (bieg), showing results in while (1. Plewa, 2. Kmiecik, 3. Zimicki) and sort by average thanks to DataTables. After every sort (by 3's, points, average, even name) I need to show first column as 1, 2, 3, 4, 5 and so on.

It's Speedway Manager private league individual statistics - speedway fans should know what am I talking about ;)

I'm really sorry for my poor English, but I'm trying :P

Thanks for every help!

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    bSortable is what you are looking for: http://datatables.net/usage/columns#bSortable :-)

    Allan
  • pawelekgnopawelekgno Posts: 7Questions: 0Answers: 0
    Thanks for answer boss :) But that's not exactly what I'm looking for.

    I can't sort M-ce column manually, but when I sort other column (Bieg for example) M-ce is changing location with the rest of the row... It can't ;)
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Ah in that case you need to "fix" the sorting of the first column, so it will always be sorted upon first, and then the other columns: http://datatables.net/usage/options#aaSortingFixed

    You may also need to use a sorting plug-in ( http://datatables.net/plug-ins/sorting ) to sort the M-ce column numerically, rather than as a string.

    Allan
  • pawelekgnopawelekgno Posts: 7Questions: 0Answers: 0
    edited September 2010
    aaSortingFixed forces sort by M-ce column and I can't do anything else. No idea how to use sorting-plugins...

    thanks for all help
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Oh - is it something like this that you want: http://datatables.net/examples/api/counter_column.html ?

    Allan
  • pawelekgnopawelekgno Posts: 7Questions: 0Answers: 0
    edited September 2010
    Yeah :D Love you mestre :* and sorry for misunderstanding.

    Pawe?
This discussion has been closed.