Hello,
I am using the client object model. I want to force a rebind of the grid back to page 1. I am having trouble setting the page number in the pager back to 1 (if I am on page 2 before the rebind).
This code does not always rebind - typically when already on the first page, but also under other conditions.
This code rebinds, but does not reset the page number in the pager to page 1 if I was on page 2.
So I cannot use this:
Finally, this code is equivalent to tableView.rebind() it always rebinds and gets the results for page 1 but does not set the page number in the pager to 1. The page count IS correct.
I am using the client object model. I want to force a rebind of the grid back to page 1. I am having trouble setting the page number in the pager back to 1 (if I am on page 2 before the rebind).
This code does not always rebind - typically when already on the first page, but also under other conditions.
tableView.set_currentPageIndex(0,
true
);
This code rebinds, but does not reset the page number in the pager to page 1 if I was on page 2.
var
tableView = $find(radGridPracticesClientID).get_masterTableView();
tableView.rebind();
So I cannot use this:
if
(currentPageIndex == 0) {
tableView.rebind();
}
else
{
// buggy - does not always rebind - e.g. when new results are less than 1 page
tableView.set_currentPageIndex(0,
true
);
}
Finally, this code is equivalent to tableView.rebind() it always rebinds and gets the results for page 1 but does not set the page number in the pager to 1. The page count IS correct.
var currentPageIndex = 0;
.
.
PageMethods.GetPracticesAndCount(currentPageIndex, pageSize,
sortExpressions, filterExpressions, installationID,
environmentalWeight, regulatoryWeight,
publicPerceptionWeight, healthAndSafetyWeight,
includeAspects, includeImpacts, checkedCommandIDs, selectedLocationIDs,
rebindPracticeGridResult);
}
function rebindPracticeGridResult(result) {
var tableView = $find("ctl00_PlaceHolderMain_Practice1_RadGridPractices").get_masterTableView();
tableView.set_dataSource(result.Practices);
tableView.dataBind();
tableView.set_virtualItemCount(result.PracticeCount);
}