mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
* fixes issue #1999 add dynamic name(object name) to exportAsCSV filename * make requested changes
This commit is contained in:
parent
28311fd4dd
commit
fab1def790
@ -9,6 +9,7 @@
|
||||
enableSort="true"
|
||||
auto-scroll="autoScroll"
|
||||
default-sort="defaultSort"
|
||||
export-as="{{ exportAs }}"
|
||||
class="tabular-holder has-control-bar">
|
||||
</mct-table>
|
||||
</div>
|
||||
|
@ -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) {
|
||||
|
@ -78,6 +78,8 @@ define(
|
||||
this.domainObject = objectUtils.toNewFormat($scope.domainObject.getModel(),
|
||||
$scope.domainObject.getId());
|
||||
|
||||
this.$scope.exportAs = this.$scope.domainObject.getModel().name;
|
||||
|
||||
_.bindAll(this, [
|
||||
'destroy',
|
||||
'sortByTimeSystem',
|
||||
|
Loading…
Reference in New Issue
Block a user