csv()
Exports data from a grid into a CSV file
csv(config?: object): string;
Parameters:
config
- (optional) an object with export settings. You can specify the following settings for export to CSV:asFile?: boolean
- (optional) defines whether Grid should be exported to a file, true by default. To export Grid only as a CSV string, you need to set asFile:falsename?: string
- (optional) "grid" by default. The name of the exported CSV file (if asFile is not set to false)rowDelimiter?: string
- (optional) a newline ("\n") by default. A separator between rows, can be a tab - "\t", or any other valuecolumnDelimiter?: string
- (optional) a comma (",") by default. A separator between columns, can be a semicolon - ";", or any other value
Returns:
A CSV string with Grid data
Example
// default export
grid.export.csv();
// export with config settings
grid.export.csv({
name: "my_file", // the name of a ready CSV file
rowDelimiter: "\t", // the delimiter used to separate rows
columnDelimiter: ";" // the delimiter used to separate columns
});
Related samples: Grid. Export to xlsx and csv
Related article: Exporting Grid