Bootstrap-table: AngularJS ng-click on data-formatter button

Created on 22 Oct 2016  路  3Comments  路  Source: wenzhixin/bootstrap-table

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?

not-supported

Most helpful comment

@Shawn-2016 I'm not using Angular plugin instead simple JavaScript library. But my clicks function are in AngualarJS.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alejandrofm picture alejandrofm  路  4Comments

lmarqs picture lmarqs  路  3Comments

ME-at-GH picture ME-at-GH  路  3Comments

tianyaxue picture tianyaxue  路  3Comments

e1xsd picture e1xsd  路  4Comments