123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: admin
- * Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['bi/admin/common/slideout/BasePane', 'bi/admin/multitenancy/views/TenantsListView', 'bi/admin/nls/StringResource'], function (BasePane, TenantsListView, StringResource) {
- /**
- * Sample content view that extends the glass View class
- *
- */
- var TenantsListPane = BasePane.extend({
- init: function init(options) {
- TenantsListPane.inherited('init', this, arguments);
- $.extend(this, options);
- this.title = StringResource.get('multitenancy');
- this.enableTenantMenuItem = false;
- },
- _getNewTenantsListView: function _getNewTenantsListView(spec) {
- return new TenantsListView(spec);
- },
- renderBody: function renderBody($body) {
- this.listView = this._getNewTenantsListView({
- glassContext: this.glassContext,
- el: $body,
- showAddButton: true,
- showListHeader: true,
- slideout: this.slideout,
- parent: this
- });
- this._bindEvents();
- return this.listView.render();
- },
- _bindEvents: function _bindEvents() {
- this.listView.on('addItem', function () {
- if (this.slideout.child) {
- this.slideout.child.hide();
- }
- this.openSlideout();
- }.bind(this));
- this.slideout.$el.on('com.ibm.bi.multitenant.properties', function (e, data) {
- this.listView.doSetProperties(data);
- }.bind(this));
- },
- openSlideout: function openSlideout(tenant) {
- this.glassContext.appController.showSlideOut({
- parent: this.slideout,
- content: {
- module: 'bi/admin/multitenancy/slideout/TenantsDetailPane',
- id: 'TenantsDetailPane',
- tenant: tenant
- }
- });
- },
- reOpenSlideout: function reOpenSlideout() {
- this.glassContext.appController.showSlideOut({
- parent: this.slideout.parent,
- overlay: true,
- width: "400px",
- label: this.title,
- content: {
- module: "bi/admin/multitenancy/slideout/TenantsListPane",
- id: 'TenantsListPane',
- title: this.title,
- showGobackButton: true
- }
- });
- },
- reload: function reload() {
- this.$body.empty();
- this.render();
- }
- });
- return TenantsListPane;
- });
|