Design Issues of FixedColumns plugin

Design Issues of FixedColumns plugin

linuslinus Posts: 8Questions: 0Answers: 0
edited September 2013 in Plug-ins
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.

Replies

  • allanallan Posts: 63,679Questions: 1Answers: 10,498 Site admin
    Thanks for the feedback. Unfortunately I can't look at this in detail right now, but I've bookmarked this post so I can come back to it when I do have a little bit of time to spend getting FixedColumns up to scratch!

    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
  • linuslinus Posts: 8Questions: 0Answers: 0
    Mmm, I'm using 2.0.3. Where can I get 2.5.0?
  • allanallan Posts: 63,679Questions: 1Answers: 10,498 Site admin
    https://github.com/DataTables/FixedColumns/tree/master/media/js
  • linuslinus Posts: 8Questions: 0Answers: 0
    I see extensive changes, great work!
    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.
  • allanallan Posts: 63,679Questions: 1Answers: 10,498 Site admin
    Can you link me to a test case which shows the alignment issues so I can fix it please?

    Allan
  • linuslinus Posts: 8Questions: 0Answers: 0
    edited September 2013
    Please forgive me, it's used in our project, so I can't give your a test case. I can only tell you it has layout issue when multiple columns are fixed and sorting is used.
    By the way, I find this plugin doesn't support hidden columns in fixed columns. Is there any plan to support this?
  • allanallan Posts: 63,679Questions: 1Answers: 10,498 Site admin
    That's unfortunate, as my test case with multiple columns fixed, currently lays out correctly, so I'm not sure what is going on and without a way to reproduce the error, it will probably ship with it.

    > 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
  • ArtjomArtjom Posts: 48Questions: 0Answers: 0
    Well, here is one test case but I hope that it is already bookmarked :).

    http://live.datatables.net/ekajav/6/
  • allanallan Posts: 63,679Questions: 1Answers: 10,498 Site admin
    Certainly is! Still not sure why that one is going belly up. Really must make some time to figure it out.

    Allan
This discussion has been closed.