Skip to content

Commit

Permalink
Ensure table updates when page settings update
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thomasneirynck committed Sep 21, 2016
1 parent bde2591 commit 0cf2202
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core_plugins/table_vis/public/table_vis_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 0cf2202

Please sign in to comment.