Hi,
I am getting so bogged down with this one:
I need to perform server side paging with this kendo grid control but every example i've see is MVC >_<<br mode="hold" />
I'm pretty sure I need to use the parameter map? or maybe add a function to my read method?
So here is my grid control:
<div id="grid" style="margin-bottom: 20px"></div>
<span id="notification"></span>
<script>
$(function () {
var hub = $.connection.agentServicesHub;
var hubStart = $.connection.hub.start().done(function () {
$("#notification").kendoNotification({
width: "100%",
position: {
top: 0,
left: 0
}
});
$("#grid").kendoGrid({
height: 550,
editable: false,
sortable: true,
columns: [
{ field: "FullName" },
{ field: "Email" },
{ field: "FlightNumber" },
{ field: "Status" }
],
dataSource: {
type: "signalr",
autoSync: true,
push: function(e) {
var notification = $("#notification").data("kendoNotification");
notification.success(e.type);
},
schema: {
total: function(response) {
return response.Total;
},
data: function(response) {
return response.Data;
},
model: {
id: "Id",
fields: {
"Id": { editable: false, type: "Number" },
"FullName": { type: "string" },
"FlightNumber": { type: "string" },
"Status": { type: "string" }
}
}
},
serverPaging: true,
pageSize: 10,
transport: {
signalr: {
promise: hubStart,
hub: hub,
server: {
read: "claimIssuesRead",
update: "update",
destroy: "destroy",
create: "create"
},
client: {
read: "claimIssuesRead",
update: "update"
}
}
}
},
pageable: {
pageSizes: true,
refresh: true,
buttonCount: 5
}
});
});
});
</script>
My Hub method/s:
#region Kendo Grid
public DataSourceResult ClaimIssuesRead(DataSourceRequest request)
{
AgentHubListPassengerFilter filter = new AgentHubListPassengerFilter
{
Status = (int)PassengerClaimStatusEnum.Unpaid_NoPaymentDetails,
PageSize = request.Take,
PageIndex = request.Skip / request.Take
};
int count;
var data = AgentHubListPassenger.Search(filter, out count);
return new DataSourceResult { Data = data, Total = count };
}
public AgentHubListResponse<AgentHubListPassenger> ClaimIssuesRead()
{
AgentHubListPassengerFilter filter = new AgentHubListPassengerFilter
{
Status = (int)PassengerClaimStatusEnum.Unpaid_NoPaymentDetails,
};
int count;
var data = AgentHubListPassenger.Search(filter, out count);
return new AgentHubListResponse<AgentHubListPassenger>(data, count);
}
#endregion
I've been playing with these hub methods but I can't get any to fire when I have
serverPaging:true
Can anyone give me a webforms example of server pagination?
Thanks ^_^
Andy