angular-datatables
angular-datatables copied to clipboard
delete raw after can't refresh datatable angularjs?
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) {
});
}
}
Check the example.