or
class MyViewModel extends kendo.data.ObservableObject { items: kendo.data.DataSource; constructor(myItems: kendo.data.DataSource) { super(); super.init(this); this.items = myItems; } addToCart(e): void { alert("Hello There!"); }}var myData: Array<any> = [ { "id": 1, "name": "Sashimi salad", "price": 12.0, "image": "http://demos.telerik.com/kendo-ui/content/spa/websushi/images/200/sashimi-salad.jpg", "category" : "Cold starters", "description" : "Organic greens topped with fresh sashimi, wasabi soy vinaigrette.", "featured" : true }, { "id": 2, "name": "Chirashi sushi", "price": 21.0, "image": "http://demos.telerik.com/kendo-ui/content/spa/websushi/images/200/chirashi-sushi.jpg", "category" : "Cold starters", "description" : "Sushi bar variety with sushi rice.", "featured" : false}];var myItems = new kendo.data.DataSource({ schema: { model: {} }, data: myData });var viewModel: MyViewModel = new MyViewModel(myItems);var myView = new kendo.View("index-template", { model: viewModel });myView.render($("#application"));<script type="text/x-kendo-template" id="index-template"> <ul data-role="listview" data-bind="source: items" data-template="item" id="main"></ul> </script><script type="text/x-kendo-template" id="item"> <li class="products"> <a class="view-details" href="\#"> <img class="main-image" src="#= image #" alt="#: name#" title="#: name #" /> <strong data-bind="text: name"></strong> <span class="price"><span>$</span><span data-bind="text: price"></span></span> </a> <button class="add-to-cart" data-bind="click: addToCart">Add to cart</button> </li></script><div id="application"></div>var indexModel = kendo.observable({ items: myItems, addToCart: function (e) { alert("Hello There!"); }});<!DOCTYPE html><html><head> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css"> <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.1008/styles/kendo.common.min.css"> <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.1008/styles/kendo.rtl.min.css"> <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.1008/styles/kendo.default.min.css"> <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.1008/styles/kendo.dataviz.min.css"> <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.1008/styles/kendo.dataviz.default.min.css"> <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.1008/styles/kendo.mobile.all.min.css"></head><body ng-app='app'> <div ng-controller='Ctrl'> <div>Add two tabs, click on the 2nd, then the 3rd. Then click on tabs 1 or 2. <a href="" ng-click="addTab()">{{label}}</a> </div> <div id="tabstrip" kendo-tab-strip> <ul> <li class='k-state-active'>Tab 1</li> </ul> <div>This is content for tab 1</div> </div> </div><script src="//code.jquery.com/jquery-1.11.0.min.js"></script><script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script><script src="//code.angularjs.org/1.3.0/angular.min.js"></script><script src="//cdn.kendostatic.com/2014.2.1008/js/kendo.all.min.js"></script><script>(function(){ var app = angular.module('app', ['kendo.directives']); app.controller('Ctrl', function($scope) { var i = 2; $scope.label = "Add Tab"; $scope.addTab = function() { $('#tabstrip').kendoTabStrip().data('kendoTabStrip').append({ text: 'Tab ' + i, content: 'This is context for tab ' + i }); i++; }; });})();</script></body></html>
errorWindow.data("kendoWindow").actions = ["Close"];
Recreated the window to the same id.
Both technics do not work...
Regards
Adrian
