I have the following multi select from telerik on my asp.net mvc project
<
div
class
=
"demo-section user-selection"
>
<
h3
class
=
"title"
>Select customers</
h3
>
@(Html.Kendo().MultiSelect()
.Name("customers")
.DataTextField("givenName")
.DataValueField("description")
.Placeholder("No users selected")
.Events(events => events.Change("TestFunc"))
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetCustomers", "Home");
});
})
.Height(300)
//.HtmlAttributes(new { style = "width: 400px" })
.HeaderTemplate("
<
div
class=\"dropdown-header\">" +
"
<
span
class=\"k-widget k-header\">Photo</
span
>" +
"
<
span
class=\"k-widget k-header\">Contact info</
span
>" +
"
</
div
>")
.ItemTemplate("
<
span
class=\"k-state-default\">
<
img
class=\"userPhoto\" src=\"" + Url.Content("http://yarris.design/images/userCentered.png") + "\" />
</
span
>" +
"
<
span
class=\"k-state-default\">
<
h3
>#: data.givenName #</
h3
>
<
p
>#: data.description #</
p
>
</
span
>")
.TagTemplate("
<
img
class=\"tag-image\" src=\"" + Url.Content("http://yarris.design/images/userCentered.png") + "\" alt=\"\" />" +
"#: data.givenName #")
)
</
div
>
Everytime someone is selected i want to do some operations, right now im reading the selected with this javascript
function
TestFunc() {
var
multiselect = $(
"#customers"
).data(
"kendoMultiSelect"
);
// get data items for the selected options.
var
dataItem = multiselect.dataItems();
console.log(dataItem);
}
I would like to know how can i read it in my HomeController.cs instead.