Hi all,
i'd tried the samples of kendo grid and worked on server paging and if i'd set server paging is true then the each and every page click will send to my wcf service
and return back... but it will take all the datas from the server
any one please tell me how to do on this server paging????
this is my sample code
and this is my WCF code:
can any one tell me how to do this
i'd tried the samples of kendo grid and worked on server paging and if i'd set server paging is true then the each and every page click will send to my wcf service
and return back... but it will take all the datas from the server
any one please tell me how to do on this server paging????
this is my sample code
griddatasource=
new
kendo.data.DataSource({
transport: {
read:
function
(option) {
$.ajax({
url:
'http://localhost:53788/ReportKendo.svc/getGrid'
,
dataType:
'json'
,
success:
function
(data) {
option.success(JSON.parse(data.d));
}, error:
function
(doc) {
alert(
"Grid load Error"
)
}
});
}
},
serverPaging:
true
,
pageSize: 15,
schema: {
model: {
fields: {
serialnumber: { type:
"string"
},
jobcode: { type:
"string"
},
mname: { type:
"string"
},
vouchertype: { type:
"string"
},
dummyvouno: { type:
"string"
},
dummyvoudate: { type:
"string"
},
voucherno: { type:
"string"
},
voucherdate: { type:
"string"
},
Createdby: { type:
"string"
},
amount: { type:
"string"
},
currencycode: { type:
"string"
},
trncurrency: { type:
"string"
},
ispaid: { type:
"string"
},
isiuv: { type:
"string"
},
isreverse: { type:
"string"
},
isprovisionalvoucher: { type:
"string"
},
voucherstatus: { type:
"string"
},
subcode: { type:
"string"
},
credate: { type:
"string"
},
aurthtime: { type:
"string"
},
billno: { type:
"string"
},
billdate: { type:
"string"
},
subledgername: { type:
"string"
}
}
}
}
});
$(
"#grid"
).kendoGrid({
dataSource: griddatasource,
serverPaging:
true
,
groupable:
true
,
sortable:
true
,
selectable:
true
,
filterable:
true
,
reorderable:
true
,
resizable:
true
,
columnMenu:
true
,
pageable: {
refresh:
true
,
pageSizes:
true
},
detailInit: subgrid,
aggregate: [{ field:
"amount"
, aggregate:
"sum"
}],
columns: [{
field:
"jobcode"
,
width: 120,
title:
"Job Code"
}, {
field:
"mname"
,
width: 300,
title:
"Job Name"
},
{
field:
"vouchertype"
,
width: 120,
title:
"Voucher Type"
,
}, {
field:
"dummyvouno"
,
width: 130,
title:
"Ref Voucher No."
,
}, {
field:
"dummyvoudate"
,
width: 150,
title:
"Ref Voucher Date"
,
}, {
field:
"voucherno"
,
width: 120,
title:
"Voucher No."
,
}, {
field:
"voucherdate"
,
width: 120,
title:
"Voucher Date"
,
}, {
field:
"Createdby"
,
width: 150,
title:
"Created By"
,
}, {
field:
"amount"
,
width: 100,
title:
"Amount"
, FooterTemplate:
"Amount: #= sum #"
,
}, {
field:
"currencycode"
,
width: 120,
title:
"Job Currency"
,
}, {
field:
"trncurrency"
,
width: 120,
title:
"Trans Currency"
,
}, {
field:
"ispaid"
,
width: 130,
title:
"Is Paid/Received"
,
}, {
field:
"isiuv"
,
width: 90,
title:
"Is IUV"
,
}, {
field:
"isreverse"
,
width: 100,
title:
"Reversed"
,
}, {
field:
"isprovisionalvoucher"
,
width: 165,
title:
"Is Provisional Voucher"
,
}, {
field:
"voucherstatus"
,
width: 100,
title:
"Status"
,
}, {
field:
"subcode"
,
title:
"Narration"
,
width: 270
}, {
field:
"credate"
,
title:
"Created Date"
,
width: 110
}, {
field:
"aurthtime"
,
title:
"Authorised Date"
,
width: 130
}, {
field:
"billno"
,
title:
"Bill No."
,
width: 90
}, {
field:
"billdate"
,
title:
"Bill Date"
,
width: 110
}, {
field:
"subledgername"
,
title:
"Subledger Name"
,
width: 200
}
]
});
and this is my WCF code:
public
object
getGrid(){
str =
"select serialnumber,jobcode,mname,vouchertype,dummyvouno,CONVERT(varchar,cast(dummyvoudate as date),105) as dummyvoudate ,voucherno,CONVERT(varchar,cast(voucherdate as date),105) as voucherdate,Createdby,amount,currencycode,trncurrency,ispaid,isiuv,isreverse,isprovisionalvoucher,voucherstatus,jobcode+' '+CONVERT(VARCHAR(23),trandate, 121) as subcode,CONVERT(varchar,cast(credate as date),105) as credate,CONVERT(varchar,cast(authtime as date),105) as aurthtime,billno,CONVERT(varchar,cast(billdate as date),105) as billdate,subledgername from vinfohvoucherview"
;
ds = obj.WsQGetRecSet(str,
"vmacmvouchercontrol"
,
ref
errormsg, registry);
return
JsonConvert.SerializeObject(ds.Tables[0]);
}
can any one tell me how to do this