From 0cf220229994d0da48345565b28f8611006dd231 Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Wed, 21 Sep 2016 19:38:29 -0400 Subject: [PATCH] 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. --- 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;