[docTable/row] emit a renderComplete event, count in table directive

This commit is contained in:
spalger 2016-11-23 11:58:21 -07:00
parent 4945e088c1
commit 641f9af0e3
2 changed files with 8 additions and 1 deletions

View file

@ -140,6 +140,7 @@ module.directive('kbnTableRow', function ($compile) {
// trim off cells that were not used rest of the cells
$cells.filter(':gt(' + (newHtmls.length - 1) + ')').remove();
$el.trigger('renderComplete');
}
/**

View file

@ -24,7 +24,7 @@ uiModules.get('kibana')
infiniteScroll: '=?',
filter: '=?',
},
link: function ($scope) {
link: function ($scope, $el) {
let notify = new Notifier();
$scope.limit = 50;
$scope.persist = {
@ -55,6 +55,12 @@ uiModules.get('kibana')
$scope.limit += 50;
};
$el.attr('has-render-count', 'true');
$el.attr('render-count', '0');
$el.on('renderComplete', () => {
$el.attr('render-count', parseInt($el.attr('render-count'), 10) + 1);
});
// This exists to fix the problem of an empty initial column list not playing nice with watchCollection.
$scope.$watch('columns', function (columns) {
if (columns.length !== 0) return;