On my main page:
Javascript:
my PageMethod call:
PageMethods.GetDataAndCount(findString, sortSQL, sessionKey, sortName, pageIndex, pageSize, qmarkUpdateGrid);
My Javascript callback function:
function qmarkUpdateGrid(result)
{
var data = result.data;
var count = result.count;
// selectedRow is within resultset not current page
var selectedRow = result.selectedRow;
var pageIndex = result.pageIndex;
var searchLabel = result.searchLabel;
var sl = $get("<%= labGetItem.ClientID %>");
var init = sl.getAttribute("init");
sl.innerHTML = searchLabel;
var mtv = $find("<%= grdList.ClientID %>").get_masterTableView();
mtv.set_dataSource(data);
mtv.dataBind();
mtv.set_virtualItemCount(count);
mtv.set_currentPageIndex(pageIndex);
if (selectedRow < 0)
{
mtv.clearSelectedItems();
}
else
{
var rowIndex = selectedRow - (mtv.get_pageSize()*pageIndex);
mtv.get_dataItems()[rowIndex].set_selected(true);
}
}
My web method returns:
result.data => 1 page of data
result.count => total rows for all pages
result.selectedRow => if this was a find request then row number within all pages
result.pageIndex => if this was a find request then it might be on different page (data contains correct page)
result.searchLabel => search label will change depending on what col search is for
The problem i have is when i do a find request and it goes to a different page than what was displayed at time of event, It fires another OnCommand event when i set currentPageIndex on grid control?
I need logic to stop this extra event. I already the correct page in grid.
Javascript:
my PageMethod call:
PageMethods.GetDataAndCount(findString, sortSQL, sessionKey, sortName, pageIndex, pageSize, qmarkUpdateGrid);
My Javascript callback function:
function qmarkUpdateGrid(result)
{
var data = result.data;
var count = result.count;
// selectedRow is within resultset not current page
var selectedRow = result.selectedRow;
var pageIndex = result.pageIndex;
var searchLabel = result.searchLabel;
var sl = $get("<%= labGetItem.ClientID %>");
var init = sl.getAttribute("init");
sl.innerHTML = searchLabel;
var mtv = $find("<%= grdList.ClientID %>").get_masterTableView();
mtv.set_dataSource(data);
mtv.dataBind();
mtv.set_virtualItemCount(count);
mtv.set_currentPageIndex(pageIndex);
if (selectedRow < 0)
{
mtv.clearSelectedItems();
}
else
{
var rowIndex = selectedRow - (mtv.get_pageSize()*pageIndex);
mtv.get_dataItems()[rowIndex].set_selected(true);
}
}
My web method returns:
result.data => 1 page of data
result.count => total rows for all pages
result.selectedRow => if this was a find request then row number within all pages
result.pageIndex => if this was a find request then it might be on different page (data contains correct page)
result.searchLabel => search label will change depending on what col search is for
The problem i have is when i do a find request and it goes to a different page than what was displayed at time of event, It fires another OnCommand event when i set currentPageIndex on grid control?
I need logic to stop this extra event. I already the correct page in grid.