or
@<
div
id
=
"searchform"
>
<
form
method
=
"get"
action
=
"@Href("
~/Collection/Search")"
class
=
"search"
>
<
ul
>
<
li
>
<
input
type
=
"text"
name
=
"q"
value
=
"@q"
class
=
"k-textbox"
required />
</
li
>
<
li
>
<
button
class
=
"k-button"
id
=
"search"
>Search</
button
>
</
li
>
</
ul
>
</
form
>
<
div
class
=
"status"
>
</
div
>
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
var validator = $("#searchform").kendoValidator({
rules: {
custom: function (input) {
return input.val().length > 3;
}
},
messages: {
custom: "You need 3 or more characters",
required: "Oops, you forgot me!",
email: function (input) {
return getMessage(input);
}
}
}).data("kendoValidator");
$("#search").click(function () {
if (validator.validate() == false) {
}
});
});
</
script
>
</
div
>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
></
title
>
<
link
href
=
"../Styles/kendo.common.css"
rel
=
"Stylesheet"
/>
<
link
href
=
"../Styles/kendo.default.css"
rel
=
"Stylesheet"
/>
<
script
src
=
"../Scripts/kendo/jquery.min.js"
></
script
>
<
script
src
=
"../Scripts/kendo/kendo.core.js"
></
script
>
<
script
src
=
"../Scripts/kendo/kendo.data.js"
></
script
>
<
script
src
=
"../Scripts/kendo/kendo.chart.js"
></
script
>
</
head
>
<
body
>
<
div
id
=
"example"
class
=
"k-content"
>
<
div
>
<
div
id
=
"chart"
></
div
>
</
div
>
<
script
type
=
"text/javascript"
>
function createChart() {
$("#chart").kendoChart({
theme: $(document).data("kendoSkin") || "default",
dataSource: {
transport: {
read: {
url: "test.json",
dataType: "json"
}
},
sort: {
field: "Program",
dir: "asc"
}
},
title: {
text: "Signup Count"
},
legend: {
position: "bottom"
},
seriesDefaults: {
type: "pie",
labels: {
template: "${ value } - ${ category }",
visible: true
}
},
series: [{
field: "SignupCount",
categoryField: "Program"
}],
tooltip: {
visible: false
}
});
}
$(document).ready(function () {
setTimeout(function () {
createChart();
// Initialize the chart with a delay to make sure
// the initial animation is visible
}, 400);
$(document).bind("kendo:skinChange", function (e) {
createChart();
});
});
</
script
>
</
div
>
</
body
>
</
html
>
MemoryStream stream = GPCO.JSON.Serialize(stats.Programs);
string
response = GPCO.Convert.BytesToUTF8(stream.GetBuffer());
Response.Clear();
Response.ContentType =
"application/json"
;
Response.Write(response);
<
ul
id
=
"navigation_menu"
class
=
"navigation_menu"
></
ul
>
<
ul
id
=
"footer_menu"
class
=
"footer_menu"
></
ul
>
<!-- TEMPLATES -->
<
script
id
=
"navigation_menu_template"
type
=
"text/x-kendo-template"
>
<
li
><
a
href
=
"#=url#"
target
=
"#=target#"
title
=
"#=title#"
>#=text#</
a
></
li
>
</
script
>
<
script
id
=
"footer_menu_template"
type
=
"text/x-kendo-template"
>
<
li
><
a
href
=
"#=url#"
target
=
"#=target#"
title
=
"#=title#"
>#=text#</
a
></
li
>
</
script
>
<!-- INITIALIZE -->
<
script
type
=
"text/javascript"
>
var navigation_menu = $("#navigation_menu").kendoMenu();
var footer_menu = $("#footer_menu").kendoMenu();
$(document).ready(function () {
function menu_initialize() {
$("#navigation_menu").html(kendo.render(navigation_menu_template, this.view()));
$("#footer_menu").html(kendo.render(footer_menu_template, this.view()));
}
var navigation_menu_template = kendo.template($("#navigation_menu_template").html());
var footer_menu_template = kendo.template($("#footer_menu_template").html());
var menu_datasource = new kendo.data.DataSource(
{
transport:
{
read: "xml/navigation.xml"
},
schema:
{
type: "xml",
data: "/navigation/menu/item",
model:
{
fields:
{
item_id: "item_id/text()",
parent_id: "parent_id/text()",
text: "text/text()",
url: "url/text()",
target: "target/text()",
title: "title/text()",
google_sitemap_priority: "google_sitemap_priority/text()",
google_sitemap_frequency: "google_sitemap_frequency/text()",
main_inclusion: "main_inclusion/text()",
footer_inclusion: "footer_inclusion/text()"
}
}
},
change: menu_initialize
});
var navigation_menu_datasource = menu_datasource;
var footer_menu_datasource = menu_datasource;
navigation_menu_datasource.filter({ field: "main_inclusion", operator: "eq", value: "true" });
footer_menu_datasource.filter({ field: "footer_inclusion", operator: "eq", value: "true" });
navigation_menu_datasource.read();
footer_menu_datasource.read();
});
</
script
>