Open veto64 opened 4 years ago
example usage : .jqGrid("navButtonAdd", "#grid_toppager", { caption: "Download CSV", id:"download", buttonicon: "fa-file-excel-o", onClickButton: function(err,res){ jQuery(this).jqGrid("jqgrid_download",'csv'); } });
Can you change code so it will have few new parameters, with default values:
Line 50: jqgrid_download: function (format , separator = ',', endline = '\n' )
Line 76: let csv = "data:text/csv;charset=utf-8," + rows.map(e => e.join(separator)).join(endline);
So there can be different separators and line ends used (we use here ';' as separator, and windows line end is '\r\n')
And, can you organize line 52 as switch/case, so it can be easily extended for more formats?
apologize for late reply,
i just changed it: https://github.com/veto64/jqGrid/blob/master/plugins/jqgrid_download.js
hi, i would like to start contribute to this great project and i added a small plugin to download the grid as a CSV file. please guide me about any code style standards and your requirements
thanks, veto