I'm using angularJS to add, edit, delete rows in my table and the button is added using the built-in data-formatter
<th compile="details" data-formatter="deleteRowbyId">Action</th>
function deleteRowbyId(value, row) {
var content = '<a ng-click="injectedFunction(' + row + ')" class="btn btn-default">Delete</a>';
return content;
}
But seems the injected HTML is not complied and AngularJS function is not firing when clicked on Delete button. Any suggestion?
use onclick="angular.element(this).scope().injectedFunction('+row+')"
or angular.element(this).controller().injectedFunction(
This depends on whether you assign function to scope or return in map from controller.
@vickyrathee
How do you use data-formatter with angular? I am unable to do that.
[(https://github.com/wenzhixin/bootstrap-table/issues/2713)]
Thanks.
@Shawn-2016 I'm not using Angular plugin instead simple JavaScript library. But my clicks function are in AngualarJS.
Most helpful comment
@Shawn-2016 I'm not using Angular plugin instead simple JavaScript library. But my clicks function are in AngualarJS.