Author Topic: Selct which columns are included in exportData()  (Read 159 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Selct which columns are included in exportData()
« on: August 13, 2024, 11:10:18 pm »
I have a grid, with many columns hidden because the user might not want to see them,so for exportData() I set the parameter skipHiddenCols=false and in "eachCol" I set col.hidden=true.  All good as I want every column exported.

However, sometimes I don't want a particular column exported.  It is hidden in the grid but not by user choice, I have chosen to hide it as it is not relevent due to particular parameters, but might be relevent and visible to the user if other parameters are set.

The issue is that I SOMETIMES don't want that column to export, but I want all OTHER columns, including the hidden ones to export. 

The problem is:
  • If I set "skipHiddenCols=true" and in "eachCol" set col.hidden=true, the hidden columns do not get passed to "eachCol" so they are not included in the export.
  • If I set "skipHiddenCols=false" the hidden columns are not included in the export.
  • If I set "skipHiddenCols=false" and in "eachCol" set col.hidden=true, all the columns are included in the export.
  • NOW THE PROBLEM. If I set "skipHiddenCols=false" and in "eachCol" set col.hidden=true EXCEPT for my special column, all the columns are still shown !!!  This seems like a bug.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: Selct which columns are included in exportData()
« Reply #1 on: August 13, 2024, 11:34:13 pm »
Please mention the kind of export out of Excel, PDF, HTML, CSV.

Quote
The issue is that I SOMETIMES don't want that column to export, but I want all OTHER columns, including the hidden ones to export.

Specific columns can be excluded from exported data by setting the property skipExport to true.

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Re: Selct which columns are included in exportData()
« Reply #2 on: August 13, 2024, 11:46:16 pm »
Sorry xlsx.

I found a workaround, but I suspect it's something else.  Please delete the thread.