toCSV

exports data of a data component to a CSV document

object toCSV(string|object id, [object options] );

Parameters

idstring|objectthe exported view or its id
optionsobjectoptional, a set of configuration options that define what data will be displayed in the CSV file

Returns

objecta "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 is 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

  1. providing a custom filename
  2. stripping HTML tags from the cells
  3. setting custom columns for export
  4. defining custom header or template for data in the specified column
  5. including extra fields into export
  6. rendering a template set in the widget's dataset
  7. setting the desired columns' delimiter
  8. disabling file download in a browser, if necessary
  9. ignoring particular columns during export
  10. omitting the header or footer of Datatable during export
  11. outputting certain data from the data set of Datatable
See also
Back to top