mirror of
https://github.com/nasa/openmct.git
synced 2024-12-21 14:07:50 +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"
|
enableSort="true"
|
||||||
auto-scroll="autoScroll"
|
auto-scroll="autoScroll"
|
||||||
default-sort="defaultSort"
|
default-sort="defaultSort"
|
||||||
|
export-as="{{ exportAs }}"
|
||||||
class="tabular-holder has-control-bar">
|
class="tabular-holder has-control-bar">
|
||||||
</mct-table>
|
</mct-table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -88,13 +88,18 @@ define(
|
|||||||
setDefaults($scope);
|
setDefaults($scope);
|
||||||
|
|
||||||
$scope.exportAsCSV = function () {
|
$scope.exportAsCSV = function () {
|
||||||
var headers = $scope.displayHeaders;
|
var headers = $scope.displayHeaders,
|
||||||
|
filename = $(element[0]).attr('export-as');
|
||||||
|
|
||||||
exportService.exportCSV($scope.displayRows.map(function (row) {
|
exportService.exportCSV($scope.displayRows.map(function (row) {
|
||||||
return headers.reduce(function (r, header) {
|
return headers.reduce(function (r, header) {
|
||||||
r[header] = row[header].text;
|
r[header] = row[header].text;
|
||||||
return r;
|
return r;
|
||||||
}, {});
|
}, {});
|
||||||
}), { headers: headers });
|
}), {
|
||||||
|
headers: headers,
|
||||||
|
filename: filename
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.toggleSort = function (key) {
|
$scope.toggleSort = function (key) {
|
||||||
|
@ -78,6 +78,8 @@ define(
|
|||||||
this.domainObject = objectUtils.toNewFormat($scope.domainObject.getModel(),
|
this.domainObject = objectUtils.toNewFormat($scope.domainObject.getModel(),
|
||||||
$scope.domainObject.getId());
|
$scope.domainObject.getId());
|
||||||
|
|
||||||
|
this.$scope.exportAs = this.$scope.domainObject.getModel().name;
|
||||||
|
|
||||||
_.bindAll(this, [
|
_.bindAll(this, [
|
||||||
'destroy',
|
'destroy',
|
||||||
'sortByTimeSystem',
|
'sortByTimeSystem',
|
||||||
|
Loading…
Reference in New Issue
Block a user