You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/09/18 08:43:06 UTC
[06/26] ignite git commit: IGNITE-6251 Clear selection from removed
rows.
IGNITE-6251 Clear selection from removed rows.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8741acce
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8741acce
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8741acce
Branch: refs/heads/ignite-6149
Commit: 8741acce15f50f978257da193cce2a5e2c5bd816
Parents: 1fcc96d
Author: vsisko <vs...@gridgain.com>
Authored: Fri Sep 15 18:02:59 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Sep 15 18:02:59 2017 +0700
----------------------------------------------------------------------
.../list-of-registered-users.controller.js | 22 +++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8741acce/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
index 58e93b4..2e36c5c 100644
--- a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
+++ b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
@@ -71,10 +71,15 @@ export default class IgniteListOfRegisteredUsersCtrl {
.then(() => {
const i = _.findIndex($ctrl.gridOptions.data, (u) => u._id === user._id);
- if (i >= 0)
+ if (i >= 0) {
$ctrl.gridOptions.data.splice(i, 1);
- })
- .then(() => $ctrl.adjustHeight($ctrl.gridOptions.data.length));
+ $ctrl.gridApi.selection.clearSelectedRows();
+ }
+
+ $ctrl.adjustHeight($ctrl.gridOptions.data.length);
+
+ return $ctrl._refreshRows();
+ });
};
const toggleAdmin = () => {
@@ -165,6 +170,8 @@ export default class IgniteListOfRegisteredUsersCtrl {
fastWatch: true,
exporterSuppressColumns: ['actions'],
exporterCsvColumnSeparator: ';',
+ rowIdentity: (row) => row._id,
+ getRowIdentity: (row) => row._id,
onRegisterApi: (api) => {
$ctrl.gridApi = api;
@@ -193,6 +200,8 @@ export default class IgniteListOfRegisteredUsersCtrl {
$ctrl.countries = _.values(_.groupBy(data, 'countryCode'));
$ctrl.adjustHeight(data.length);
+
+ $ctrl._refreshRows();
});
};
@@ -246,6 +255,13 @@ export default class IgniteListOfRegisteredUsersCtrl {
this.selected = ids;
}
+ _refreshRows() {
+ if (this.gridApi) {
+ this.gridApi.grid.refreshRows()
+ .then(() => this.selected.length && this._updateSelected());
+ }
+ }
+
exportCsv() {
this.gridApi.exporter.csvExport('visible', 'visible');
}