Reputation: 1863
In ag-grid, one of the header columns I have the following :
headerCellRenderer : function(params) {
params.$scope.assignRegHrsInput = "";
return '<span>' + data.headerName + '</span></br><input class="exp-param-header-input" type="text" ng-model="assignRegHrsInput"> </br> <span ng-click="changeAllAssignedRegHrs(assignRegHrsInput)"> <span class="glyphicon glyphicon-download"></span> Apply To All</span>'
}
And I have
$scope.changeAllAssignedRegHrs = function(tobeChanged) {
alert(tobeChanged);
}
But the when I click the above span element click event is not firing up. Can any help me how to fix it?
In my grid options I have specified :
angularCompileRows: true,
angularCompileHeaders: true
But still the ng-click event on the span is not firing up.
In the browser console, I can see my header for this span as shown below:
<span class="ng-scope">
<span>R Hours</span>
<br>
<input class="exp-param-header-input ng-pristine ng-untouched ng-valid" type="text" ng-model="assignRegHrsInput">
<br>
<span ng-click="changeAllAssignedRegHrs(assignRegHrsInput)">
<span class="glyphicon glyphicon-download"></span>
Apply To All
</span>
</span>
Upvotes: 2
Views: 4152
Reputation: 1863
In headerCellRenderer
, using it as params.changeAllAssignedRegHrs = function() {}
, should solve the problem of firing the on ng-click
.
Upvotes: 1