TableTools export choose columns to export AND visible

TableTools export choose columns to export AND visible

titi71191titi71191 Posts: 6Questions: 0Answers: 0
edited October 2012 in TableTools
Hi everyone,

I am using TableTools and I have already discovered many usefuls features.

I have a an HTML table which use TableTools. The first column is used for a link which clicked loads a new pages for details about
the record so I don't want this column to be exported.
I already read the documentation about mColumns and the array argument, eg : [1, 2, 3, 4...]. But the matter is that i can also hide columns (dynamically) and I don't want the hidden columns to be exported.

So how can I combine the argument "visible" and the array for mColumns? Is it possible or is there another method?

Thank You,

PS: Sorry for mistakes if there are any...

Replies

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    [code]
    mColumns: "visible"
    [/code]

    :-).

    Allan
  • titi71191titi71191 Posts: 6Questions: 0Answers: 0
    Thank you Allan but I think I was not clear with my demand.

    I have 8 colunms, some are visibles and some are hiddens. My first column is always visible.

    I want to export all the visibles columns except the first column.

    Anyway thank you for your quick response, :)
  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    I see - there isn't currently an option for that in TableTools - you'd need to modify the source to add that option.

    Allan
  • titi71191titi71191 Posts: 6Questions: 0Answers: 0
    Ok.

    Thank you Allan :).
  • titi71191titi71191 Posts: 6Questions: 0Answers: 0
    Another question Allan :


    Where is located the source code for the xls export?


    Thank you,
  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    In this file (the whole file is dedicated to file export, so its not just one individual part): https://github.com/DataTables/TableTools/blob/master/media/as3/ZeroClipboardPdf.as

    Allan
  • titi71191titi71191 Posts: 6Questions: 0Answers: 0
    edited October 2012
    Thank you Allan. I'll try to figure it out.

    Regards,
  • titi71191titi71191 Posts: 6Questions: 0Answers: 0
    I solved the problem.

    I went to TableTools.js and in the method _fnGetDataTablesData i just modified the first value of the index, for the headers and columns loop, from 0 to 1.


    Regards,
  • titi71191titi71191 Posts: 6Questions: 0Answers: 0
    Thank you very much,
  • kashinathnkashinathn Posts: 1Questions: 0Answers: 0
    edited May 2013
    To get only visible columns to be exported I changed code in function _fnGetDataTablesData
    Replaced condition if(aColumnsInc[i]) with if (dt.aoColumns[i].bVisible) in Header and Body parts.

    This might be usefull for others who like to export only visible columns.
  • vipjerryvipjerry Posts: 1Questions: 0Answers: 0

    @kashinathn thnx your fix help saved me a lot of trouble and works perfectly

This discussion has been closed.