toCSV
exports data of a data component to a CSV document
promise toCSV(string|object id, [object options] );
| id | string|object | the exported view or its id |
| options | object | optional, a set of configuration options that define what data will be displayed in the CSV file |
| promise | a "promise" object. The promise is resolved with the contents of a CSV file that is ready for downloading. |
Example
webix.toCSV($$("table"), {
filename: "table",
// other config options
});
Related samples
Details
The method returns all data specified in the dataset of a component, or in the columns parameter of the DataTable view.
The data are exported into a CSV document with the "Data" name by default.
However, you may need to get some particular data, or customize the file name.
Export API allows
- providing a custom filename
- stripping HTML tags from the cells
- setting custom columns for export
- defining custom header or template for data in the specified column
- including extra fields into export
- rendering a template set in the widget dataset
- setting the desired columns' delimiter
- disabling file download in a browser, if necessary
- ignoring particular columns during export
- omitting the header or footer of Datatable during export
- outputting certain data from the data set of Datatable
See also
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support,
connect with other developers, and share your feedback there.