HI in kendo grid page change event,If we keep ajax call,pagination first time only working.After that not at all working.Kindly provide the solution.Below is my code
var grid = $("#xmlgrid").data("kendoGrid");
var pager = grid.pager;
pager.bind('change', test_pagechange);
var pageSizeDropDownList = grid.wrapper.children(".k-grid-pager").find("select").data("kendoDropDownList");
pageSizeDropDownList.bind('change', test_pagesizechange);
function test_pagechange()
{
var curr_pageno = grid.dataSource.page();
var curr_pagesize = grid.dataSource.pageSize();
var localxmldetails = [];
if (curr_pageno == 1)
{
alert("page 1 is clicked");
localxmldetails = common_1stpage_dropdownchange();
bindingToDatasource(localxmldetails);
//alert(JSON.stringify(localxmldetails));
//mainxmldetails = localxmldetails;
//alert(JSON.stringify(mainxmldetails));
}
else
{
$.ajax({
type: "GET",
url: "/WC3/Resources/XML/ClientDetails.xml",
dataType: "xml",
async:false,
success: function (xml) {
var i = 0, ClientID, ClientName, AppDesc, WC3ClientKey, startval, endval;
startval = (curr_pageno - 1) * (curr_pagesize) + 1;
endval = (startval + curr_pagesize) - 1;
$(xml).find('Values').each(function () {
i++;
if (i >= startval && i <= endval) {
localxmldetails.push({ ClientID: $(this).find('ClientID').text(), ClientName: $(this).find('ClientName').text(), AppDesc: $(this).find('AppDesc').text(), WC3ClientKey: $(this).find('WC3ClientKey').text() })
}
else {
if (i < tp) {
return true;
}
else
return false;
}
});
//alert(JSON.stringify(xmldetailsLocal));
}
});
bindingToDatasource(localxmldetails);
}
}