From edbf465c8303cc1c73dc8f245814c9f5bc10fd7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 1 Sep 2015 18:55:49 +0200 Subject: [PATCH] Fix missing totals in sunstone tabs --- .../public/app/tabs/groups-tab/datatable.js | 2 ++ src/sunstone/public/app/tabs/vdcs-tab/datatable.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/sunstone/public/app/tabs/groups-tab/datatable.js b/src/sunstone/public/app/tabs/groups-tab/datatable.js index 87b9fc19ce..83d7bf5ebb 100644 --- a/src/sunstone/public/app/tabs/groups-tab/datatable.js +++ b/src/sunstone/public/app/tabs/groups-tab/datatable.js @@ -77,6 +77,8 @@ define(function(require) { */ function _elementArray(element_json) { + this.totalGroups++; + var element = element_json[XML_ROOT]; var users_str = "0"; diff --git a/src/sunstone/public/app/tabs/vdcs-tab/datatable.js b/src/sunstone/public/app/tabs/vdcs-tab/datatable.js index 2dbeaf8ecb..5bd8714650 100644 --- a/src/sunstone/public/app/tabs/vdcs-tab/datatable.js +++ b/src/sunstone/public/app/tabs/vdcs-tab/datatable.js @@ -57,12 +57,16 @@ define(function(require) { "you_selected_multiple": Locale.tr("You selected the following VDCs:") }; + this.totalElements = 0; + TabDataTable.call(this); } Table.prototype = Object.create(TabDataTable.prototype); Table.prototype.constructor = Table; Table.prototype.elementArray = _elementArray; + Table.prototype.preUpdateView = _preUpdateView; + Table.prototype.postUpdateView = _postUpdateView; return Table; @@ -71,6 +75,8 @@ define(function(require) { */ function _elementArray(element_json) { + this.totalElements++; + var element = element_json[XML_ROOT]; return [ @@ -96,4 +102,12 @@ define(function(require) { return l; } + + function _preUpdateView() { + this.totalElements = 0; + } + + function _postUpdateView() { + $(".total_vdcs").text(this.totalElements); + } });