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.");//showing smart popup alert
- } else {
- $scope.bindSmartAlert(" Template", "Do you really want to delete the " + name + " 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 " + name + " is deleted successfully.";
- if (result.Result.Status !== 0) {
- alertType = Enum.AlertType.Error;
- message = "Opps! Something went wrong that's why the template " + name + " 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.getTemplatesList();
- }
- $scope.bindPopUpMessages(alertType, message);//showing smart popup alert
- }
- }).error(function (err) {
- });
- }
- });
- }
- };

MayankPosted Nov 9, 2016, 4:30 AM