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/
274 stars 144 forks source link

Request: add ability to specify type bound #11

Closed BrianVallelunga closed 9 years ago

BrianVallelunga commented 12 years ago

I'd like the ability to specify a type that is used when binding values to Kendo controls. For example, if I have a DropDownList with "true" and "false" as options, I'd like the the underlying view model to store these as booleans. I can do this with a custom binding such as the one discussed in the answer here: http://stackoverflow.com/questions/10510683/knockoutjs-version-2-1-0-bind-boolean-value-to-select-box

Obviously since I'm using the Knockout - Kendo bindings, this is more difficult. Any thoughts on how this might best be integrated into the Kendo bindings?

Thanks

rniemeyer commented 12 years ago

I'll have to think about how that could fit into the bindings. I don't see a simple solution at the moment.

Outside of a change to the bindings, how do you feel about a solution like: http://jsfiddle.net/rniemeyer/rGdwa/

or applied in the binding like:

http://jsfiddle.net/rniemeyer/rGdwa/2/