angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

delete raw after can't refresh datatable angularjs?

Open Coderwill opened this issue 9 years ago • 1 comments

i want to refresh datatable after delete raw.how can do that task i don't know any one please let me know. i have write this code for delete raw.

$scope.dtColumns = [
DTColumnBuilder.newColumn("fullName", "Full Name").withOption('name', 'firstname'),
DTColumnBuilder.newColumn("username", "Name").withOption('name', 'username'),
DTColumnBuilder.newColumn("email", "Email").withOption('name', 'email'),
DTColumnBuilder.newColumn(null).withTitle('Action').withOption('defaultContent', ' ').notSortable()
.renderWith(function (data, type, full, meta) {
if (data.UserCount > 1)
return '' + '';
})
]

$scope.dtOptions = userservice.GetAllUser(DTOptionsBuilder)
.withOption('processing', true)
.withOption('serverSide', true)
.withPaginationType('full_numbers')
.withDisplayLength(50)
.withOption('aaSorting', [3, 'desc'])

function createdRow(row, data, dataIndex) {
    $compile(angular.element(row).contents())($scope);
}
}]);
$scope.delete= function (id) {
        if (confirm("Are you sure want to delete?") == true) {
            var getData = userservice.Deleteuser(id);
            getData.then(function (Msg) {
                if (Msg.statusText == "OK") {
                //here what code i written i don't know
                }
            }, function (err) {

            });
        }
    }

Coderwill avatar Mar 27 '17 07:03 Coderwill

Check the example.

l-lin avatar Mar 30 '17 15:03 l-lin