12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: admin
- * Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['underscore', 'bi/admin/nls/StringResource', 'bacontentnav/common/ui/ListControl'], function (_, StringResource, ListControl) {
- var BackupList = ListControl.extend({
- init: function init(options) {
- var dataTableOptions = {
- columns: this._getColumnSpecs(),
- accessibleLabel: StringResource.get('content'),
- multiSelect: false,
- getJSONDataCallback: this._getBackupList.bind(this),
- emptyFolderString: StringResource.get('noBackups')
- };
- _.extend(this, dataTableOptions);
- BackupList.inherited('init', this, arguments);
- _.extend(this, options);
- },
- _getColumnSpecs: function _getColumnSpecs() {
- return [{
- 'type': 'Text',
- 'label': StringResource.get('backupName'),
- 'propertyName': 'name',
- 'scope': 'row',
- 'clickCallback': function clickCallback() {}
- }];
- },
- _getBackupList: function _getBackupList() {
- return $.Deferred().resolve({
- data: this.contentView.items
- }).promise();
- },
- getSelectedBackupName: function getSelectedBackupName() {
- var selectedObj = this.getSelectedObjects();
- if (selectedObj == null || selectedObj.length === 0) {
- return "";
- } else {
- return selectedObj[0].name;
- }
- }
- });
- return BackupList;
- });
|