Question simple sur les ui grid sur la méthode gridApi.expandable.on.rowExpandedStateChanged
Bonjour,
j'utilise les ui-grid de Angularjs,
j'utilise le listener "gridApi.expandable.on.rowExpandedStateChanged" qui est déclanché lorsqu'une row est déployé
Voici mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| $scope.searchCfgridOptions = {
................................
................................
onRegisterApi : function(gridApi) {
$scope.gridApi = gridApi;
$scope.gridApi.expandable.on.rowExpandedStateChanged(
$scope, function(row) {
var childrenLength = $scope.gridApi.treeBase.getRowChildren( row ).length;
console.log('childrenLength='+childrenLength);
if (row.isExpanded) {
$scope.gridCapacityFileHeight += 30 * childrenLength;
}
});
} |
et mon browser m'indique l'erreur suivante
Citation:
TypeError: Cannot read property 'on' of undefined
at Object.$scope.searchCfgridOptions.onRegisterApi
Merci d'avance pour vos suggestions