kendo-labs / knockout-kendo

A project to create a robust set of Knockout.js bindings for the Kendo UI widgets.
http://kendo-labs.github.com/knockout-kendo/
273 stars 144 forks source link

Multiselect initialized multiple times #118

Open jmsolutionsgroup opened 10 years ago

jmsolutionsgroup commented 10 years ago

When I'm trying to use the MVC Wrappers for Kendo alongside knockout I'm unable to use the multiselect wrapper. It appears that the plugin is initializing the control even if it already exists from the MVC Wrapper.

I would like to turn the code below

into something like this in Razor

@(Html.Kendo().MultiSelect()
        .Name("selectMultiple")
        .DataTextField("Name")
        .DataValueField("Id")
        .DataSource(ds => ds
            .Read(rd => rd.Url("/api/Names").Type(HttpVerbs.Get))
        )
        .AutoBind(false)
        .HtmlAttributes(new { data_bind = "value: selectedValue" })
)
lcornejo commented 10 years ago

this is probably a Kendo bug/feature if you read the value method documentation that forces a data fetch each time its set. Telerik mentions a workaround