Place ColVis in custom div?

Place ColVis in custom div?

anaganag Posts: 48Questions: 2Answers: 7
edited December 2011 in General
I'm using ColVis and it's currently in the top part of the table. Is there any way to unbind this from the table and have it inserted into a custom div which I place in my page using it's class ColVis TableTools thanks

Replies

  • allanallan Posts: 61,653Questions: 1Answers: 10,094 Site admin
    What you can do is use the fnInitComplete callback function for DataTables and then simply move the element to wherever you want in the DOM using standard jQuery or DOM methods.

    It is also possible to create a new ColVis instance using "new ColVis( oDTSettings, init );", but I suspect the first option is probably easier :-).

    Allan
  • anaganag Posts: 48Questions: 2Answers: 7
    Hi Allan,

    Thanks, this is what I came up with pretty simple but works. Any pros/cons to this method?

    [code]
    "fnInitComplete": function () {
    $('.ColVis').appendTo("#CustomColVis");
    }
    [/code]
  • allanallan Posts: 61,653Questions: 1Answers: 10,094 Site admin
    Pros: Simple, Works
    Cons: Can't think of any :-)

    That looks like exactly like what is needed - nice one.

    Regards,
    Allan
This discussion has been closed.