Skip to content

Commit

Permalink
ng-grid-csv-export.js: only stringify properties
Browse files Browse the repository at this point in the history
* Only try to iterate over the properties of columnDefs.
  • Loading branch information
pcaessayrs committed Apr 18, 2014
1 parent c976fc6 commit acc2942
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/ng-grid-csv-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ function ngGridCsvExportPlugin (opts) {
self.scope = scope;
function showDs() {
var keys = [];
for (var f in grid.config.columnDefs) { keys.push(grid.config.columnDefs[f].field);}
for (var f in grid.config.columnDefs) {
if (grid.config.columnDefs.hasOwnProperty(f))
{
keys.push(grid.config.columnDefs[f].field);
}
}
var csvData = '';
function csvStringify(str) {
if (str == null) { // we want to catch anything null-ish, hence just == not ===
Expand Down

0 comments on commit acc2942

Please sign in to comment.