-
Notifications
You must be signed in to change notification settings - Fork 64
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
Reload table on specific page #160
Comments
I got the same bug. Do you have any fix? |
So, usually the page return to 1 when a filter is applied to the table, because by filtering something you will probably have less or more stuff to show. As default will always go back to 1. What you instead guys want, is keeping the same page or the last possible available if the you filter the table in some way. Am I understood correctly? Because if is like that, we need make some sort of API feature to turn on and off this special case. |
I'd like use the last params used at the getResource and stay on the page what register was edited. How I had to change the filterBy to force the update, the params reset to page 1. |
Could I change the params used at getResource or reload the table without change the filterBy? |
I created two property and update the method. Now it work. I need add to filterBy the params: page and reloadTable; Code: updateServerSideResource = function (updateFrom, newValue, oldValue) {
if (updateFrom === 'filters') {
var resetPage = false;
var hasBreak = false;
var hasNewproperty = true;
if (newValue.page) {
for (var oldproperty in oldValue) {
if (oldproperty === 'reloadTable' || oldproperty === "page") {
continue;
}
for (var newproperty in newValue) {
if (newproperty === 'reloadTable' || newproperty === "page") {
continue;
}
if (oldproperty === newproperty) {
hasNewproperty = false;
if (oldValue[oldproperty] !== newValue[newproperty]) {
resetPage = true;
hasBreak = true;
}
break;
}
}
if (hasNewproperty) {
resetPage = true;
break;
}
hasNewproperty = true;
if (hasBreak) {
break;
}
}
} else {
resetPage = true;
}
if (resetPage) {
$scope.params['page'] = 1;
} else {
$scope.params['page'] = $scope.params.page;
}
}
$scope.url = buildUrl($scope.params, $scope.filters);
if ($scope.reload) {
$scope.reload = function () {
$scope.resourceCallback($scope.url, angular.copy($scope.params))
.then(function (resource) {
setDirectivesValues(resource);
});
};
}
if (initNow || updateFrom === 'params') {
var paramsObj = angular.copy($scope.params);
paramsObj.filters = $scope.filters;
$scope.resourceCallback($scope.url, paramsObj)
.then(function (resource) {
setDirectivesValues(resource);
});
}
}; Thank you. |
@Zizzamia Yes that's exactly what I need. As another example suppose that there is a refresh button on top of table which reloads the table using the same parameters. |
Where i can find the version 0.5.9 ?I just encounter the same problem |
i am a new guy who use github . i can't understand the content verywell cause English is not my mother language . Sorry |
I create a new option name $scope.init = {
'count': 5,
'page': 1,
'sortBy': 'name',
'sortOrder': 'dsc',
'filterBase': 1
}; if you set Happy Holidays, and many thanks to push it hard on this. 😄 |
👍 |
Also just release on bower the version |
Thank you so much! Happy Holidays! |
Hello, i'm using the server side table:
How do i reload the table to a specific page after removing some item at that page (eg. page 5) ?
Here's how i reload the table:
but it always goes to page 1.
i've tried setting $scope.init.page to the last page number before changing the
filterBy.changeDetector
, but nothing happened.Thanks !
The text was updated successfully, but these errors were encountered: