Column Repositioning

Column Repositioning

jacksumitjacksumit Posts: 4Questions: 0Answers: 0
edited May 2009 in General
Hi,

I want to implement column repositioning feature. For that I want to write a function which takes two intgers as parameter and thus can switch the positions of these columns.

Is it possible? If yes, Please provide guidelines to do the same.

Replies

  • allanallan Posts: 61,722Questions: 1Answers: 10,108 Site admin
    This isn't possible (at least in a trivial manner) at the moment. I have been experimenting with a plug-in which will allow exactly this, but it gets quite complicated when considering hidden columns etc. I've had to stop working on that plug-in for the time being due to time pressures but I hope to get back to it soon as it could be most useful.

    Regards,
    Allan
  • jacksumitjacksumit Posts: 4Questions: 0Answers: 0
    After writing in this forum, I have almost implemented the same using the plugin you are developing. Problem associated with hidden column is resolved by using a diffrent approach to hide column i.e. by adding display:none to css of td and th of hidden column insted of removing them from DOM. Its working fine for the tests I have performed by now.

    I may be wrong some where. Please bring to my notice if it is so.
  • allanallan Posts: 61,722Questions: 1Answers: 10,108 Site admin
    Yup - using display:none is certainly a valid option. The reason I didn't do it that way is because DataTables does remove the elements from the DOM and I didn't particularly want to change that just for a single plug-in. I just need to sit down sometime and think about the logic for the hidden columns...

    Good to hear you got it working for your use case!

    Allan
This discussion has been closed.