or
<
li
>
<
label
for
=
"cities"
>
Zip code:</
label
>
<
input
id
=
"contact_cities"
data-bind
=
"value: contact_zip"
name
=
"contact_cities"
pattern
=
"\d{5}"
placeholder
=
"Invalid zip code"
validationmessage
=
"Invalid zip code."
/><
span
class
=
"k-invalid-msg"
data-for
=
"cities"
></
span
></
li
>
<
li
>
.....
$(document).ready(function () {
var viewModel = kendo.observable({
firstName: $.cookie("firstName"),
lastName: $.cookie("lastName"),
email: $.cookie("email"),
phone: $.cookie("phone"),
contact_zip: $.cookie("zip"),
valid: false,
contactseller: function () {
if (validator.validate()) {
$.cookie("firstName", $("#firstname").val(), { expires: 7, path: '/' });
$.cookie("lastName", $("#lastname").val(), { expires: 7 , path: '/'});
$.cookie("email", $("#email").val(), { expires: 7 , path: '/'});
$.cookie("phone", $("#phone").val(), { expires: 7 , path: '/'});
$.cookie("zip", $("#contact_cities").val(), { expires: 7 , path: '/'});
status.text("Hooray! Your tickets has been booked!").addClass("valid");
} else {
status.text("Oops! There is invalid data in the form.").addClass("invalid");
}
}
});
kendo.bind($("#contactSeller"), viewModel);
var validator = $("#contactSeller").kendoValidator().data("kendoValidator"), status = $(".status");
$("#contact_cities").kendoComboBox({
placeholder: "Select zip code",
dataTextField: "Label",
dataValueField: "Value",
filter: "contains",
dataSource: {
serverFiltering: true,
transport: {
read: {
url: '@Url.Action("GetCities", "MainSearch")',
data: function () {
var combobox = $("#contact_cities").data("kendoComboBox");
return {
zip: combobox.input.val()
};
}
}
}
}
});
$("img[title]").tooltip();
$('.submit-link').click(function () {
var input = $(this).attr('id');
$("#lastId").val(input);
var window = $("#contactSeller").data("kendoWindow"); window.center(); window.open();
});
var window = $("#contactSeller").kendoWindow({
title: "Contact Seller",
visible: false,
modal: true,
resizable: false
}).data("kendoWindow");
});
e.preventDefault();I got a stack overflow
[{
Id: 1,
Name:
'Email'
,
Type:
'Email'
,
Default:
''
,
Display:
true
,
Identifier:
true
}, {
Id: 2,
Name:
'First name'
,
Type:
'Text'
,
Default:
'Fistname'
,
Display:
true
,
Identifier:
false
}, {
Id: 3,
Name:
'Last name'
,
Type:
'Text'
,
Default:
'Lastname'
,
Display:
true
,
Identifier:
false
}, {
Id: 4,
Name:
'City'
,
Type:
'Text'
,
Default:
''
,
Display:
true
,
Identifier:
false
}]
<
script
id
=
"row-template"
type
=
"text/x-kendo-template"
>
<
tr
data-uid
=
"#= Id #"
>
<
td
align
=
"center"
>
<
a
href
=
"javascript:void(0);"
data-bind
=
"click: edit"
class
=
"editRow"
>edit
</
a
>
</
td
>
<
td
data-bind
=
"text: Name"
></
td
>
<
td
data-bind
=
"text: Type"
></
td
>
<
td
data-bind
=
"text: Default"
></
td
>
<
td
align
=
"center"
><
input
type
=
"checkbox"
data-bind
=
"checked: Display"
/></
td
>
<
td
align
=
"center"
><
input
type
=
"checkbox"
data-bind
=
"checked: Identifier"
/></
td
>
</
tr
>
</
script
>
edit:
function
(e){
this
.set(
'fields['
+ (e.data.Id -1) +
'].Default'
,
'Clicked'
);
}
Hi,
Currently in KendoUI for MVC, one can load the columns for a KendoGrid by writing this in the view,
@(Html.Kendo().Grid<Object>(
.Name("Some name")
.Columns(columns =>
{
columns.LoadSettings((IEnumerable<GridColumnSettings>)ViewData["Columns"]);
})
// ...
)
where ViewData["columns"] has been set in the controller.
I'm wondering if there is some similar way of loading several series for a KendoChart. I know I could probably accomplish this using javascript and an AJAX call, but I would rather use Razor for as much as I can, and I would like to avoid making too many server calls.
Thanks!