Design Issues of FixedColumns plugin
Design Issues of FixedColumns plugin
For complex header like two rows, using FixedColumns will result in ugly layout. There is a serious design issue for this plugin:
1. Should not use fnSetColumnVis(i, false) in _fnConstrcut() function. Because you call fnDraw function at the end of _fnConstruct() function. So, you should use fnSetColumnVis(i, false, false).
2. Calling fnSetColumnVis(i, false) will result in that right table will be re-drawn many times. This means that right column headers are re-layouted many times. Many styles are changed by this call. So, you didn't copied the original headers at all. That's why you have to fore the column width in exactly the same way that DataTables does it. If you call fnSetColumnVis(i, false, false), these code can be removed.
3. If you use fnSetColumnVis(i, false, false), you can remove all "width" settings for cloned elements. This means you can remove all the "width" settings in _fnClone() funciton.
Try it! You'll find it also applies to complex column headers.
1. Should not use fnSetColumnVis(i, false) in _fnConstrcut() function. Because you call fnDraw function at the end of _fnConstruct() function. So, you should use fnSetColumnVis(i, false, false).
2. Calling fnSetColumnVis(i, false) will result in that right table will be re-drawn many times. This means that right column headers are re-layouted many times. Many styles are changed by this call. So, you didn't copied the original headers at all. That's why you have to fore the column width in exactly the same way that DataTables does it. If you call fnSetColumnVis(i, false, false), these code can be removed.
3. If you use fnSetColumnVis(i, false, false), you can remove all "width" settings for cloned elements. This means you can remove all the "width" settings in _fnClone() funciton.
Try it! You'll find it also applies to complex column headers.
This discussion has been closed.
Replies
One question - are you using the 2.5.0.dev version from git or the current release? 2.5.0.dev has changed quite a lot, although I suspect one or two of the issues might still be there!
Allan
I ever used similar methods, used in version 2.5.0, to freeze left columns. But what I froze are left "td" and "th" elements not a whole left table. I found it's difficult to synchronized these tables like "head table", "body table", "left tables". And, in version 2.5.0, there are still align issues when sorting is used in DataTables. It seems you still have a great job to do.
Allan
By the way, I find this plugin doesn't support hidden columns in fixed columns. Is there any plan to support this?
> By the way, I find this plugin doesn't support hidden columns in fixed columns. Is there any plan to support this?
Ultimately yes, but not in the immediate future.
Allan
http://live.datatables.net/ekajav/6/
Allan