Author Topic: ExportData Functionality  (Read 3558 times)

webeetle

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 2
    • View Profile
ExportData Functionality
« on: May 12, 2016, 03:20:05 pm »
Hi all,
there's a way to exclude specific column/s from the export data functionality?
For example a cell that contains a button group? 

thanks

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: ExportData Functionality
« Reply #1 on: May 12, 2016, 05:27:59 pm »
1) If it's a non-grouped column, then adding copy: false property to the column excludes it from exported data.

http://paramquery.com/pro/api#option-column-copy


2) If it's part of grouped column, then it can be excluded by hiding the column in beforeExport event and showing it back in exportData event.

Code: [Select]
beforeExport: function(){
this.getColumn({dataIndx: 'dataIndx of column' }).hidden = true;
this.option('colModel', this.option('colModel'));
},
exportData: function(){
this.getColumn({dataIndx: 'dataIndx of column' }).hidden = false;
this.option('colModel', this.option('colModel'));
}

« Last Edit: May 12, 2016, 05:33:18 pm by paramquery »

webeetle

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: ExportData Functionality
« Reply #2 on: May 12, 2016, 06:22:07 pm »
Thank you  ;)

mleitao

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: ExportData Functionality
« Reply #3 on: June 20, 2019, 12:37:44 am »
What can we do in the case of multiple exports, in my case I have two types of exports for the same grid one for the data where the user can just download all or any columns that they choose, and the another one for a standard template regardless of shown or hidden columns.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: ExportData Functionality
« Reply #4 on: June 20, 2019, 10:50:30 am »
Same logic applies to any number of exports from the grid.