colspan sorting problem - last column not sortable after adding a column

colspan sorting problem - last column not sortable after adding a column

machinariummachinarium Posts: 17Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
Hi, everyone.
I don't think it's a bug of datatable. But I still hope to get a workaround for this weird problem. Here is the thing.
My table definition is
[code]



th1
th2
th3
th4
th5
th6


th6_1
th6_2
th6_3
th6_4
th6_5





[/code]
In the javascript code, i added a column dynamically to be the first column of the table, including the header, let's say
[code]
new_th1
[/code]
And don't worry, I also added the corresponding data to that newly added column, something like this
[code]
little foxy thing
[/code]
Then the last column, i.e th6_5 is not sortable, I mean, you can not click the header of that column to do a sortion, event it's not clickable. So any thoughts how to figure it out?

Thanks

Replies

  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    When do you add the column? Before the DataTables initialisation?

    Can you link us to a test case so we can see what is happening please: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    Not before but during the DataTables initialization. When constructing each row, an extra element is added before the first .

    Regarding the test case, I need time to do this because i am developing an internal website.

    Thanks.
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    Hi, Allan,
    As you requested, I created a little example to show this weird behavior, though the 'details_open' and 'details_close' pictures are missing in the example.
    Here is the link of the example.
    http://live.datatables.net/ohamin/4/edit#javascript,html,live

    Best wishes,
    Arthur
This discussion has been closed.