ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on June 17, 2016, 03:42:09 pm

Title: exportData
Post by: queensgambit9 on June 17, 2016, 03:42:09 pm
Hi

When using exportData function, I get the rendered html code for the field.

Ex:
Code: [Select]
render: function (ui) {
                   
           return "<span>"+ ui.cellData +"</span>";
           }

Will in export be <span>value</span>...I only want to get the value...

Is this possible?
Title: Re: exportData
Post by: paramvir on June 17, 2016, 06:51:06 pm
There are many ways to do that. Few of them:

Pass render: false to exportData() method

or

add exportRender: false to the column.
http://paramquery.com/pro/api#option-column-exportRender
Title: Re: exportData
Post by: queensgambit9 on June 17, 2016, 07:03:37 pm
Great, thanks.
I assume its not possible to use render: false and still have the percentage sign written out in the export, or is there another way to do it?

Code: [Select]
render: function (ui) {
                   
           return "<span>"+ ui.cellData +"%</span>";
           }
Title: Re: exportData
Post by: paramvir on June 17, 2016, 08:29:03 pm
There is Export property available in column.render callback which can be used:

Code: [Select]
render: function (ui) {                   
  if( ui.Export ){
     return ui.cellData +"%";
  }
  else{
     return "<span>"+ ui.cellData +"%</span>";
  }

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

In this case, render: true should be passed to exportData()