From 1904f56c7307ff6e8a486322e2cfb3c46840f4e3 Mon Sep 17 00:00:00 2001 From: Elastic Jasper Date: Thu, 22 Sep 2016 09:55:07 -0400 Subject: [PATCH] Backport PR #8422 --------- **Commit 1:** Ensure table updates when page settings update The entire table should also refresh when one of the options changes. Otherwise, the rows are not filled in correctly to the bottom of the page. * Original sha: 0cf220229994d0da48345565b28f8611006dd231 * Authored by Thomas Neirynck on 2016-09-21T23:38:29Z --- src/core_plugins/table_vis/public/table_vis_controller.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core_plugins/table_vis/public/table_vis_controller.js b/src/core_plugins/table_vis/public/table_vis_controller.js index 1d7af7d3c1b7e..e48484b93f98c 100644 --- a/src/core_plugins/table_vis/public/table_vis_controller.js +++ b/src/core_plugins/table_vis/public/table_vis_controller.js @@ -19,7 +19,13 @@ module.controller('KbnTableVisController', function ($scope, Private) { $scope.uiState.set('vis.params.sort', newSort); }); - $scope.$watch('esResponse', function (resp, oldResp) { + /** + * Recreate the entire table when: + * - the underlying data changes (esResponse) + * - one of the view options changes (vis.params) + */ + $scope.$watchMulti(['esResponse', 'vis.params'], function ([resp]) { + let tableGroups = $scope.tableGroups = null; let hasSomeRows = $scope.hasSomeRows = null;