From a1d47db41138e6938220caf2102c3fe31433c944 Mon Sep 17 00:00:00 2001 From: csoni Date: Fri, 5 May 2017 15:44:24 +0530 Subject: [PATCH] Add provisioning string for "Not available" and block device wiping Added default value in provisioning status Added listener to handle row click event, Which will enabled/disabled wipe button base on wipe(provisioning) status --- js/data/ProvisioningStatus.js | 3 ++- js/settings/MDMSettingsWidget.js | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/js/data/ProvisioningStatus.js b/js/data/ProvisioningStatus.js index 033dc05..bbda386 100644 --- a/js/data/ProvisioningStatus.js +++ b/js/data/ProvisioningStatus.js @@ -60,8 +60,9 @@ Zarafa.plugins.mdm.data.ProvisioningStatus = Zarafa.core.Enum.create({ return _('Wipe Requested', 'plugin_mdm'); case Zarafa.plugins.mdm.data.ProvisioningStatus.WIPE_EXECUTED: return _('Wipe Executed', 'plugin_mdm'); + default: + return _('Not Available', 'plugin_mdm'); } - return ''; } }); diff --git a/js/settings/MDMSettingsWidget.js b/js/settings/MDMSettingsWidget.js index 899fea4..e2371af 100644 --- a/js/settings/MDMSettingsWidget.js +++ b/js/settings/MDMSettingsWidget.js @@ -90,7 +90,8 @@ Zarafa.plugins.mdm.settings.MDMSettingsWidget = Ext.extend(Zarafa.settings.ui.Se }], listeners : { rowdblclick: this.onRowDblClick, - scope : this + rowclick: this.onRowClick, + scope: this } }] }] @@ -211,6 +212,18 @@ Zarafa.plugins.mdm.settings.MDMSettingsWidget = Ext.extend(Zarafa.settings.ui.Se manager : Ext.WindowMgr, record : record }); + }, + + /** + * Function is called if a row in the grid gets clicked. + * Which is use to disabled wipe button if wipe status is not available. + * @param {Ext.grid.GridPanel} grid The Grid on which the user clicked + * @param {Number} rowIndex The Row number on which was clicked. + */ + onRowClick : function (grid, rowIndex) + { + var record = grid.getStore().getAt(rowIndex); + this.wipeBtn.setDisabled(!Ext.isDefined(record.get('wipestatus'))); } });