or
cols.Bound(p => p.ID)
.Template(@<
text
><
a
id
=
"Foo_\@item.ID"
href
=
"#someLink"
> @item.ID </
a
></
text
>);
.Template(@<
text
><
a
id
=
"@item.ID"
href
=
"#someLink"
> @item.ID </
a
></
text
>);
public
class
LedgerViewModel
{
public
int
? lindex {
get
;
set
; }
public
int
? linvoice {
get
;
set
; }
public
string
lperiod {
get
;
set
; }
public
decimal
? lamount {
get
;
set
; }
}
[WebMethod(Description =
"Gets ledger info"
)]
public
List<LedgerViewModel> Read()
{
using
(var db =
new
LedgerConnection())
{
return
db.ledgers.Where(x => x.lmatter ==
"2007714"
)
.Select(l =>
new
LedgerViewModel
{
lindex = l.lindex,
linvoice = l.linvoice,
lamount = l.lamount,
lperiod = l.lperiod
}).ToList();
}
}
<
ArrayOfLedgerViewModel
>
<
LedgerViewModel
>
<
lindex
>698567</
lindex
>
<
linvoice
>871181</
linvoice
>
<
lperiod
>0511</
lperiod
>
<
lamount
>0.0000</
lamount
>
</
LedgerViewModel
>
<
LedgerViewModel
>
<
lindex
>698568</
lindex
>
<
linvoice
>871181</
linvoice
>
<
lperiod
>0511</
lperiod
>
<
lamount
>0.0000</
lamount
>
</
LedgerViewModel
>
</
ArrayOfLedgerViewModel
>
dataSource: {
transport: { }
read: {
url:
"GetLedger.asmx/Read"
,
contentType:
"application/json; charset=utf-8"
,
type:
"POST"
}
},
schema: {
type:
"xml"
,
data:
"/ArrayOfLedgerViewModel/LedgerViewModel"
,
model: {
fields: {
linvoice:
"linvoice/text()"
,
lperiod:
"lperiod/text()"
,
lamount:
"lamount/text()"
}
}
},
sort: {
field:
"lperiod"
,
dir:
"asc"
}
}
var
crudServiceBaseUrl =
"Default.aspx"
;
$(
"#files"
).kendoUpload({
async: {
saveUrl: crudServiceBaseUrl +
"/FileUpload"
,
autoUpload:
false
},
multiple:
false
,
showFileList:
true
,
});
populateCalendar:
function (Holiday) {
var holidaydateList = []
//constructing holidaydatelist array from Holiday object...
$.each(Holiday, function (index, model) {
var day = model.HolidayDate.toString();
holidaydateList.push({ HolidayDate: day.substring(6, day.length - 2), HolidayData: model.HolidayName });
});
$("#forecastCalendar").kendoCalendar({
//value: today,
month: {
// template for dates in month view
content:
'# jQuery.each([' + holidaydateList + '],function(index,item){ #' +
'# if (item.HolidayDate == +data.date) { #' +
'<div style="background-color: Aqua">item.HolidayData</div>' +
'# } else { #' +
'<div></div>' +
'# } #' +
'# }); #' +
'#= data.value #'
},
footer: "Today - #=kendo.toString(data, 'd') #"
});
data = {
ListPrice: {
value: 8.99
}
}
columns: [
{
field:
'ListPrice'
,
title:
'List Price'
,
template:
'#= ListPrice.Value #'
}
]