fixes issue #1999 - Use Object name as default export filename (#2001)

* fixes issue #1999
add dynamic name(object name) to exportAsCSV filename

* make requested changes
This commit is contained in:
Deep Tailor
2018-05-16 13:20:58 -07:00
committed by Pete Richards
parent 28311fd4dd
commit fab1def790
3 changed files with 10 additions and 2 deletions

View File

@@ -88,13 +88,18 @@ define(
setDefaults($scope);
$scope.exportAsCSV = function () {
var headers = $scope.displayHeaders;
var headers = $scope.displayHeaders,
filename = $(element[0]).attr('export-as');
exportService.exportCSV($scope.displayRows.map(function (row) {
return headers.reduce(function (r, header) {
r[header] = row[header].text;
return r;
}, {});
}), { headers: headers });
}), {
headers: headers,
filename: filename
});
};
$scope.toggleSort = function (key) {