I am using np table in angular for data binding. ng table show paging and total number of record but when I add new row or remove one row from data model in ng table. Total row is reflected but total number of record and paging not reflected.
I have used bleow code Any one can help me..
- $scope.viewDeleteTemplateModel = function (templateId, name) {
- if (parseInt(templateId, 10) <= 0) {
- $scope.bindPopUpMessages(Enum.AlertType.Error, "TemplateId must be greater than zero.");
- } else {
- $scope.bindSmartAlert("<i class='fa fa-fw fa-reorder'></i> Template", "Do you really want to delete the <strong>" + name + "</strong> template?", function () {
- if ($scope.PropertyBag.SmartAlertResult && $scope.PropertyBag.SmartAlertResult === 1) {
- var request = "request={'OrganizationId':" + $scope.PropertyBag.OrganizationDetails.OrganizationId + ",'TemplateId':" + templateId + "}";
- $RestService.deleteTemplate(request).success(function (result) {
- if (result) {
- var alertType = Enum.AlertType.Success;
- var message = "The Template <strong>" + name + "</strong> is deleted successfully.";
- if (result.Result.Status !== 0) {
- alertType = Enum.AlertType.Error;
- message = "Opps! Something went wrong that's why the template <strong>" + name + "</strong> is not deleted.";
- } else {
- $scope.tableServerSide[tableId].data.Model.Items = _.without($scope.tableServerSide[tableId].data.Model.Items, _.findWhere($scope.tableServerSide[tableId].data.Model.Items, { TemplateId: templateId }));
- if ($scope.tableServerSide[tableId].Records !== undefined && $scope.tableServerSide[tableId].Records > 0)
- {
- $scope.tableServerSide[tableId].Records = $scope.tableServerSide[tableId].Records - 1;
- }
-
-
- }
- $scope.bindPopUpMessages(alertType, message);
- }
- }).error(function (err) {
-
- });
- }
- });
- }
-
- };