How to export dhtmlxGrid data to the csv file?

How to export dhtmlxGrid data to the csv file?

You can export data to csv string by

var csv = grid.serializeToCSV()

the string can be sent to the server , which will return it with correct headers, as CSV file.