New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ng-grid Server Side Sorting error #223
Comments
hi karim, I realize we forgot to update the documentation around some changes we made to sortInfo each of the properties of sortInfo are now arrays[] and plural. this was done to accomodate multi-column sorting. However, I see that we may need to make a change for it to work properly but I do have a workaround for now. |
hi Tim, I have changed sortinfo as array but still does not fire server method in my project. I have also change your plnkr code but code not get data in plnkr grid var app = angular.module('myApp', ['ngGrid']);
}); |
Is there anyone who can help me on this |
Hi I have fix my that issue |
The paging bar is also disappeared for new version |
its just the default options. the footer is hidden by default. please see On Fri, Mar 8, 2013 at 6:58 AM, karim017 notifications@github.com wrote:
-Tim Sweet |
ok, so for the sorting i remembered there is a scope event that you can watch for to get the current sorting info $scope.$on('ngGridEventSorted', function (sortInfo) {
alert('Sorted Info: ' +sortInfo);
}); http://plnkr.co/edit/ek3N1Dyzj6IzCK1doPuH?p=preview also fixed some issues related to this in commit 6c476f6 which will be merged into main here shortly |
fixed with #228 |
Could be something I did. But I had to use |
Hi, var app = angular.module('myApp', ['ngGrid']);
// $scope.$watch('sortInfo', function (newval, oldval) { |
@Addaymichel - I had the same problem. I believe the reason that this is happening is that the sort event is fired whenever the data of the grid is updated. With server-side sorting, I was replacing the data in the grid whenever I did a sort. This caused the ng-grid sort event to continuously fire. I needed a way to make sure that this only happened once. This was my solution:
$scope.mySort = function(col,e) {
$scope.mySortCompleted = false;
col.sort(e);
$scope.mySortCompleted = true;
};
$scope.$on('ngGridEventSorted', function() {
if ($scope.mySortCompleted) {
return;
}
// code for retrieving data from the server goes here...
}); EDIT: This is for version 2.0 of ng-grid. |
Client Side Sorting in ng-grid is working
But Server Side Sorting is not working.
Is there anyone who can help me on this issue. I am using latest version of ng-grid.
Here is my sample code..................
$scope.pagingOptions = {
pageSizes: [5, 10, 50],
pageSize: 5,
totalServerItems: 0,
currentPage: 1
};
The text was updated successfully, but these errors were encountered: