渲染Angular ui-grid的回调函数

use*_*027 7 javascript jquery angularjs angular-ui-grid

我想知道在渲染Angularjs网格后触发的回调函数是什么意味着它的所有单元格都呈现为类似$ .ready()的函数

小智 5

有两个functions可以使用,如果要在ui-grid上执行,请使用renderingComplete

onRegisterApi: function(gridApi) {
    gridApi.core.on.renderingComplete($scope, function() {
        //code to execute
    });
}
Run Code Online (Sandbox Code Playgroud)

如果您需要callback更改数据rowsRendered

onRegisterApi: function(gridApi) {
    gridApi.core.on.rowsRendered($scope, function() {
        //code to execute
    });
}
Run Code Online (Sandbox Code Playgroud)

  • 我的意思是,如果我使用`jQuery('input').length`(这些输入应该在网格单元内),我会收到“0”。但是,如果我使用超时(我不喜欢的解决方案)执行此操作,它会显示 12,因此此时网格不是 100% 呈现的。 (2认同)

use*_*027 4

计算出来的函数是 $scope.gridApi.core.on.rowsRendered()