It is possible to use Knockout in Windows 8 HTML apps. In order to bind any of the RadControls for Windows 8, you need to create a custom binding. First of all this is needed so the control can be created correctly in each instance of a template. Second, in order to apply the bindings, some of the RadControls event handlers (such as change) need to be used. Here is a simple template for the RadDropDownList control, that allows you to create a select with some items (name/value pairs).
ko.bindingHandlers.telerikDropDownList = {
init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
//create control and set properties, add handler for value binding
var bindings = valueAccessor();
//create dataSource from data array
if (bindings.options) bindings.dataSource = new Telerik.Data.DataSource(bindings.options);
var ddl = new Telerik.UI.RadDropDownList(element, valueAccessor());
For a more complete example, I am attaching a simple page that I made using the above custom binding and one of the Knockout tutorials (http://learn.knockoutjs.com/#/?tutorial=collections). You can test it by creating a new JavaScript Navigation App, adding the Telerik.UI and Knockout references and the HTML/JS files from the attached ZIP file.
Kind regards,
Lini
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.