oria / gridx

Just another powerful Dojo grid
Other
162 stars 78 forks source link

CSV header cell content is not protected against special characters #406

Open maxnikulin opened 7 years ago

maxnikulin commented 7 years ago

handleCell function in support/exporter/toCSV.js ensures correct CSV content even if a cell contains special characters (quotes, separators, newlines). The same should be done for column headers in handleHeaderCell method.

maxnikulin commented 7 years ago

To see the problem an existent test may be a bit modified. Click "Export to CSV" and inspect the first row.

--- a/tests/test_grid_exporter.js
+++ b/tests/test_grid_exporter.js
@@ -28,6 +28,9 @@ require([
                size: 1000
        });
        layout = dataSource.layouts[1];
+       layout[0].name = "System\nID";
+       layout[4].name = "icon,status";
+       layout[3].name = 'server "name';
        modules = [
                mods.CellWidget,
                mods.ExtendedSelectRow,