misalign when use Fixed Column
misalign when use Fixed Column
hi allen
i use DataTables for a long time and it gives me excellent experiencing. but i meet a problem when i use Fixed Column plugin these days.
here comes the discription:
i use ajax to get table data from server and fix the first 5 columns of head. it seems datatable works fine for the initialization. but when i click one head column, the datatable sort this column. then the misalign appears between table head and table body.
would you please do me a favor?
i use DataTables for a long time and it gives me excellent experiencing. but i meet a problem when i use Fixed Column plugin these days.
here comes the discription:
i use ajax to get table data from server and fix the first 5 columns of head. it seems datatable works fine for the initialization. but when i click one head column, the datatable sort this column. then the misalign appears between table head and table body.
would you please do me a favor?
This discussion has been closed.
Replies
i had update the test case. the case has the same issue but not getting data via ajax.
here comes the link:
http://live.datatables.net/uzogad/17/edit
when you sort the column, the head has a mislign with body.
i am not sure whether you know the test is done. would you please see it?
The Ajax data is available using `/examples/ajax/sources/{file}` - which is pointing to the files in this directory: https://github.com/DataTables/DataTables/tree/master/examples/ajax/sources
There is without doubt some misalignment in your example (I've added borders here: http://live.datatables.net/uzogad/18/edit ). I'll need to look into why this is happening. It will probably take a little bit of time to figure out what is going wrong, so I'll need to come back to this in a few days (in a bit of a rush at the moment!).
Allan
Thanks for your help. i spent some hours for this problem and here comes my found:
1) the bigger i set the width of table's parent container(div), the better the table looks.
2) i see the source code of Fixed Column plugin and found the plugin copy the head row of DataTable. then use the copy head row and DataTable's body to make up a new table (the plugin set the copied head row's height with zero, so the copied row can be not seen). because the head DataTable's head and body are not in a table, the misalignment maybe appears sometimes(just in my opinion).
3) base on 2), i reset the DataTable manually in the fnDrawCallback fuction, and there is no misalignment between head and body, but misalignment also appears between body and footer. so i think the way is not good enough. and here comes my test:
http://live.datatables.net/uzogad/20/edit#preview
is there any result now? i am sorry for asking you so frequently
did you have found out the reason yet?
Allan
hope your good news~
What to do is use the nightly version that is available here: http://datatables.net/download/build/dataTables.fixedColumns.nightly.js
You test case with that version of FixedColumns: http://live.datatables.net/uzogad/22/edit
This will all be sorted out with the next release of FixedColumns, which will be alongside DataTables 1.10.
Allan
i test the nightly version of FixedColumns via http://live.datatables.net/uzogad/22/edit
and i found another issue about it.
1) when i sort the column of "id", misalign also appears.
2) the scrollbar-x may be sometimes disabled in FF or Chrome. i will also test more about the nightly version and send the feedback to you.
at last, thank you very much and best regards
Allan