Hallo,
it's me first step in Kendo Web and I have a big Problem. (Sorry for my bad englisch)
I have a APS.NET MVC 4 Projekt.
In the @Code -Area I get the data with Linq. I convert it also to a Json-String
Then I have the HTML-Code for my KendoDropDownList
And now my Script
That dosn't work. The DropDownBox is empty. What is wrong?
Thanks in advance
Roland
it's me first step in Kendo Web and I have a big Problem. (Sorry for my bad englisch)
I have a APS.NET MVC 4 Projekt.
In the @Code -Area I get the data with Linq. I convert it also to a Json-String
@Imports Newtonsoft.Json
@code
' -- die Teams einlesen
Dim ccT = (From p2 In ctx.TeamSet Order By p2.TeamName Select p2.TeamName, p2.Id).ToList()
Dim ccTeams = JsonConvert.SerializeObject(ccT , Formatting.None)
End Code
<
input
id
=
"ecolor"
value
=
"1"
/>
And now my Script
<
script
>
$(document).ready(function () {
// create DropDownList from input HTML element
$("#ecolor").kendoDropDownList({
dataTextField: "TeamName",
dataValueField: "Id",
dataSource: '@ccTeams',
index: 0,
change: onChange2
});
var color2 = $("#ecolor").data("kendoDropDownList");
function onChange2() {
var value = $("#ecolor").val();
alert(value)
}
});
</
script
>
That dosn't work. The DropDownBox is empty. What is wrong?
Thanks in advance
Roland