jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Set header's charset when jqxGrid export to Excel › Reply To: Set header's charset when jqxGrid export to Excel
Hi soojung,
the last parameter determines the charSet. In your case, you’ve set it to “utf-8”.
Here’s the documentation for the exportdata
method:
exportdata Method
Exports all rows loaded within the Grid to Excel, XML, CSV, TSV, HTML or JSON.
The first parameter of the export method determines the export's type - 'xls', 'xml', 'html', 'json', 'pdf', 'tsv' or 'csv'.
The second parameter is the file's name. If you don't provide a file name, the Grid will export the data to a local variable.
For example:
var data = $("#jqxgrid").jqxGrid('exportdata', 'json');
The third parameter is optional and determines whether to export the column's header or not. Acceptable values are - true and false. By default, the exporter exports the columns header.
The fourth parameter is optional and determines the array of rows to be exported. By default all rows are exported. Set null, if you want all rows to be exported.
The fifth parameter is optional and determines whether to export hidden columns. Acceptable values are - true and false. By default, the exporter does not export the hidden columns.
The sixth parameter is optional and determines the url of the export server. By default, the exporter is hosted on a jQWidgets server.
The last parameter is optional and determines the char set.
Parameter Type Description
dataType String
fileName(optional) String
exportHeader Boolean
rows Array
exportHiddenColumns Boolean
serverURL String
charSet String Return Value
None
Code example
Invoke the exportdata method.
$("#jqxGrid").jqxGrid('exportdata', 'json', 'jqxGrid');
Best Regards,
Christopher
jQWidgets Team
http://www.jqwidgets.com