or
WorkTypeID: { type: "number", validation: { required: true } },var viewModel = kendo.observable({ message: {type:"info", text: "Hello World!"}});<div id="myMessageBox"> <img src="./images/infoIcon.png" alt="Hello World!" /><span>Hello World!</span></div><body> <div id="myMessageBox" data-role="infobox" data-type="message.type" data-text="message.text"></div></body>kendo.bind($("body"), viewModel);; (function ($, undefined) { "use strict"; var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget; var InfoBox = Widget.extend({ init: function (element, options) { var that = this; options = options || {}; kendo.ui.Widget.fn.init.call(that, element, options); that._infoBox(); }, options: { name: "InfoBox", type: "info", //warning, error, success text: 'Default message for an information box', infoIcon: 'http://application.travelfast.com/Production/App_Themes/App_Themes/images/icons/info/infoIcon32.gif', warningIcon: 'http://application.travelfast.com/Production/App_Themes/App_Themes/images/icons/notice/noticeIcon32.gif', errorIcon: 'http://application.travelfast.com/Production/App_Themes/App_Themes/images/icons/error/errorIcon32.gif', successIcon: 'http://application.travelfast.com/Production/App_Themes/App_Themes/images/icons/success/successIcon32.gif', autoBind: true }, type: function (value) { var that = this; if (value) { //check value is info, warning, error or success that.options.type = value; //that._refresh(); return; } else { return that.options.type; } }, text: function (value) { var that = this; if (value) { //check value is of type string that.options.text = value; //that._refresh(); return; } else { return that.options.text; } }, _infoBox: function () { var that = this; that._refresh(); }, _template: '<img src="{0}" alt="#:{1}#" /><span>#:{1}#</span>', _refresh: function() { var that = this; var template = kendo.template(kendo.format(that._template, that.options.infoIcon, that.options.text)); //How can I find the viewModel the body is bound to?????? //$(that.element).html(template(viewModel)); } }); ui.plugin(InfoBox);})(jQuery);@(Html.Kendo().TreeView() .Name("treeview") .DragAndDrop(true) .ExpandAll(true)
.Events(e => e.Drag("...").DragStart("....").Drop("...").Select("...")).... .BindTo(.... item.Text = x.Name; item.Id = x.Id item.Enabled = false; )@(Html.Kendo().TreeView() .Name("relations") .Items(treeview => treeview.Add().Text("Established Relationships for "+ Model.Mrn).HtmlAttributes(new {style="font-weight:bold;"}) .Expanded(true) .Items(root => { foreach (var dep in Model.DepartmentsUser) { if (dep.IsEnabled) { var dep1 = dep; root.Add().Text(dep.Name).Items( i => { i.Add().Items(w=>Html.Kendo().Window() .Name("window") .Title("Establishing Encounters") .Content("loading user info...") .LoadContentFrom("Action", "Controller", new { mrn = Model.Mrn, deptId = 1 }) .Iframe(true) .Draggable() .Resizable()).Text("What Established This?").SpriteCssClasses("ques-grey"); //i.Add().Url("#").Text("What Established This?").SpriteCssClasses("ques-grey"); i.Add().Text("Divisions").Items( di => { foreach (var div in dep1.Divisions) { var div1 = div; di.Add().Text(div.Name).Items(divi => { divi.Add().Text("Description: " + div1.Description); divi.Add().Text("Enabled: " + div1.IsEnabled); }).SpriteCssClasses("div-grey"); } }).Expanded(true); }). SpriteCssClasses("dept-blue");} } })).Events( e=>e.Change("removeSelectedCss")) )