1

I have a table on html page and this table have 15 records. each column have sorting functionality. There is a edit button on each row to edit row value in separate tab, its working fine before sorting of data.

Means if you have clicked on table's column than edit function is not called.

 `<table id="tbl" class="table table-striped table-bordered"
                                   datatable="ng" cellspacing="0" width="100%">
                                <thead>
                                    <tr>
                                        <th>Name</th>
                                        <th>Code</th>
                                        <th>Status</th>
                                        <th>Notes</th>
                                        <th>Description</th>
                                        <th style="text-align:center">Action</th>
                                    </tr>
                                </thead>

                                <tbody>
                                    <tr ng-repeat="e in entities">
                                        <td>{{e.name}}</td>
                                        <td>{{e.code}}</td>
                                        <td>{{getStatus(e.status)}}</td>
                                        <td>{{e.notes}}</td>
                                        <td>{{e.description}}</td>
                                        <td align="center">
                                            <a href="" ng-click="edit(e)"><span class="glyphicon glyphicon-pencil" /></a>
                                            <span style="color: #ddd;">|</span>
                                            <a href="" ng-click="confimDelete(e)"><span class="glyphicon glyphicon-trash" /></a>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>

And controller code as below :

  $scope.edit = function (entity) {
    alert('name');
    $scope.entity = entity;
    $scope.activate('view');
};

This function named as edit called until we not click on header of data table.

please suggests what is issue.. thanks in advance

Dalip Choudhary
  • 546
  • 5
  • 18

0 Answers0