Hello RAJESH,
The Scheduler widget's DataSource is not passed to the headerDateTemplate. However, in order to implement the desired functionality, you could assign the array with the data to a global variable and access it from within the template. Similar to the following:
<script>
var
dailyCapacities = [
{ date:
new
Date(
"2013/6/2"
), value: 30 },
{ date:
new
Date(
"2013/6/3"
), value: 40 },
{ date:
new
Date(
"2013/6/4"
), value: 12 },
{ date:
new
Date(
"2013/6/5"
), value: 12 },
{ date:
new
Date(
"2013/6/6"
), value: 40 },
{ date:
new
Date(
"2013/6/7"
), value: 23 },
{ date:
new
Date(
"2013/6/8"
), value: 42 },
/*..*/
];
function
percentage(date) {
var
value = 0;
var
item;
for
(
var
idx = 0; idx < dailyCapacities.length; idx++) {
item = dailyCapacities[idx];
if
(item.date.getTime() == date.getTime()) {
value = item.value;
break
;
}
}
return
value;
}
$(
function
() {
$(
"#scheduler"
).kendoScheduler({
date:
new
Date(
"2013/6/6"
),
views: [
"week"
],
dateHeaderTemplate: kendo.template(
"<u>#=kendo.toString(date, 'dd/M')#</u> - (#=percentage(date)#%)"
),
dataSource: [
/*..*/
]
});
});
</script>
Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework -
download Kendo UI now!