or
App.globalVar.generateChart =
function
(container, bcLevels, inputFilter, inURL) {
$(container).kendoChart({
dataSource: {
transport: {
read: {
url: App.constants.ROOTURL + inURL,
type:
"post"
,
contentType:
"application/json; charset=utf-8"
,
dataType:
"json"
},
sort: {
field:
"bondType"
,
dir:
"asc"
},
parameterMap:
function
(options) {
options.filter = inputFilter;
options.holdingBC = bcLevels;
return
JSON.stringify(options);
}
},
// end transport
schema: { data:
"data"
, errors:
"processErrorList"
}
},
//end datasource
legend: {
position:
"right"
,
margin: 1,
offsetX: -5,
labels: {
template:
"#= text # (#= value #%)"
}
},
chartArea: {
background:
"white"
,
width: 325,
height: 130,
margin: 1
},
seriesDefaults: {
type:
"pie"
},
plotArea: { margin: 1 },
series: [{
field:
"tmvAccrued"
,
categoryField:
"bondType"
,
colorField:
"color"
,
padding: 12,
overlay: {
gradient:
"none"
}
}],
tooltip: {
visible:
false
,
format:
"{0}%"
}
});
}
kendo.culture("en-GB");
, { field: "StartDate", title: "Date", width: 80, format: "{0:d}" }
filter: { field: "customer", operator: "eq", value: "id/text()" }
$(document).ready(function() {
var element = $("#grid").kendoGrid({
dataSource: new kendo.data.DataSource({
type: "xml", // specifies data protocol
pageSize: 6, // limits result set
serverPaging: true,
serverSorting: true,
transport: {
read: "customers.xml"
},
schema: {
type: "xml",
data: "/Customers/Customer",
model: {
fields: {
id: "id/text()",
surname: "surname/text()",
forename: "forename/text()",
email: "email/text()"
}
}
}
}),
height: 450,
sortable: true,
pageable: true,
detailInit: detailInit,
dataBound: function() {
this.expandRow(this.tbody.find("tr.k-master-row").first());
},
columns: [{
field:"id",
filterable: false
},
"surname",
"forename",
"email"
]
});
});
function detailInit(e) {
$("<
div
/>").appendTo(e.detailCell).kendoGrid({
dataSource: {
type: "xml",
transport: {
read: "orders.xml"
},
schema: {
type: "xml",
data: "/orders/order",
model: {
fields: {
id: "id/text()",
net: "net/text()",
vat: "vat/text()",
dispatched: "dispatched/text()"
}
}
},
serverPaging: true,
serverSorting: true,
serverFiltering: true,
pageSize:6,
filter: { field: "customer", operator: "eq", value: "id/text()" }
},
scrollable: false,
sortable: true,
pageable: true,
columns: [ "id", "net", "vat", "dispatched" ]
});
}
<
p
>
<
label
for
=
"categories"
>Catergories:</
label
>
@(Html.Kendo().ComboBox()
.Name("categories")
.Placeholder("Select categoryasdasda...")
.DataTextField("Cod")
.DataValueField("Des")
.DataSource(source => {
source.Read(read => {
read.Action("GetCascadeCategories", "ComboBox");
});
})
)
</
p
>
<
p
>
<
label
for
=
"products"
>Products:</
label
>
@(Html.Kendo().ComboBox()
.Name("products")
.Placeholder("Select product...")
.DataTextField("Cod")
.DataValueField("Des")
.DataSource(source => {
source.Read(read =>
{
read.Action("GetCascadeProducts", "ComboBox")
.Data("filterProducts");
})
.ServerFiltering(true);
})
.Enable(false)
.AutoBind(false)
.CascadeFrom("categories")
)
<
script
>
function filterProducts() {
return {
categories: $("#categories").val()
};
}
</
script
>
</
p
>
<
p
>
<
label
for
=
"orders"
>Orders:</
label
>
@(Html.Kendo().ComboBox()
.Name("orders")
.Placeholder("Select order...")
.DataTextField("Cod")
.DataValueField("Des")
.DataSource(source => {
source.Read(read =>
{
read.Action("GetCascadeOrders", "ComboBox")
.Data("filterOrders");
})
.ServerFiltering(true);
})
.Enable(false)
.AutoBind(false)
.CascadeFrom("products")
)
<
script
>
function filterOrders() {
return {
products: $("#filterOrders").val()
};
}
</
script
>
</
p
>
<
p
>
<
label
for
=
"ciccio"
>Ciccio:</
label
>
@(Html.Kendo().ComboBox()
.Name("ciccio")
.Placeholder("Select order...")
.DataTextField("Cod")
.DataValueField("Des")
.DataSource(source => {
source.Read(read =>
{
read.Action("GetCascadeciccio", "ComboBox");
})
.ServerFiltering(true);
})
.AutoBind(false)
.CascadeFrom("orders")
)
<
script
>
function filterOrders() {
return {
ciccio: $("#filterCiccio").val()
};
}
</
script
>
</
p
>