TableTools with ColumnFilter

TableTools with ColumnFilter

khurram712khurram712 Posts: 1Questions: 0Answers: 0
edited July 2012 in TableTools
Hi
I have an HTML table .At the start,The columns of the table are like this .

Job Card , Serial No , Version , Emp Num , Malfunction , Action

I applied datatable tool on it and applied two "extras" plugin named "TableTools" and "ColVIs".

ColVIs : http://datatables.net/release-datatables/extras/ColVis/index.html

Table Tools : http://datatables.net/release-datatables/extras/TableTools/index.html


The extra plugins work fine individually but they don't work with each other .
Lets say a user first deselects "version" and "Emp Num" columns(using ColVis Plugin).
Now The table has only these columns visible

Job Card , Serial No , Malfunction , Action

Now the user presses pdf button (of tabletool plugin)

The table in pdf file does have only those columns which were visible.But the data of
"Version" column will be overlapping data of " Malfunction"and data of "Emp Num"
will be mixed with "Action".

In other words,the export option doesnt correspond to the column selection.Any idea or
solution ??

Replies

  • itelvesitelves Posts: 2Questions: 0Answers: 0
    I'm looking for a solution to this as well. I'm in love with this plugin but this is a big show stopper for me if I can't get it to filter AND print the visible columns only.

    Thanks!
  • itelvesitelves Posts: 2Questions: 0Answers: 0
    I did some searching through the code and found this constant variable in the TableTools buttons:
    [code]
    "mColumns": "all"
    [/code]

    So I added this variable to my pdf button and it worked like a charm:
    [code]
    "aButtons": [ { "sExtends": "pdf", "mColumns": "visible" } ]
    [/code]

    The options for this variable in the code are:
    all, visible, hidden, or an array of column intergers

    Hope that helps!

    Dave
This discussion has been closed.