or
<
script
type
=
"text/x-kendo-template"
id
=
"template"
>
<
div
class
=
"toolbar"
>
<
label
class
=
"category-label"
for
=
"category"
>Show products by category:</
label
>
<
input
type
=
"search"
id
=
"category"
style
=
"width: 230px"
></
input
>
</
div
>
</
script
>
var
baseURL =
"/Chargeability/JSON"
var
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
url: baseURL,
dataType:
"json"
}
},
batch:
false
,
pageSize: 5,
serverPaging:
true
,
serverSorting:
false
,
schema: { data:
"ChargeabilityWeeks"
, total:
"TotalCount"
}
});
var
grid = $(
"#grid"
).kendoGrid({
dataSource: dataSource,
scrollable:
false
,
sortable:
true
,
columns:
[
{
title:
'Name'
,
field:
'Name'
,
template:
'#= Name #'
},
{
title:
'Weekly Requirement'
,
field:
'Weekly_req_pct'
,
template:
'#= kendo.toString(Weekly_req_pct, "p") #'
},
{
title:
'Weekly Actual'
,
field:
'Weekly_act_hrs'
,
template:
'#= Weekly_act_hrs #'
},
{
title:
'Yearly Requirement'
,
field:
'Yearly_req_pct'
,
template:
'#= kendo.toString(Yearly_req_pct, "p") #'
},
{
title:
'Yearly Actual'
,
field:
'Yearly_act_pct'
,
template:
'#= kendo.toString(Yearly_act_pct, "p") #'
},
],
pageable:
true
,
toolbar: kendo.template($(
"#template"
).html())
});
console.log(grid.find(
"#category"
));
var
dropDown = grid.find(
"#category"
).kendoDropDownList({
dataTextField:
"Name"
,
dataValueField:
"ID"
,
autoBind:
true
,
optionLabel:
"All"
,
dataSource: {
type:
"json"
,
serverFiltering:
false
,
transport: {
read:
'/Chargeability/BU_JSON'
}
}
});
series: [{
type:
"pie"
,
data: [ {
category:
"Hydro"
,
value: 312
} ]
}]
transport: {
read: {
url:
"http://localhost/myJsonService"
,
dataType:
"json"
,
},
parameterMap: kendo.data.transports.odata.parameterMap
}