or
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")) )
Imports PropertyCentral.Domain.EntitiesImports PropertyCentral.Domain.InterfacesImports PropertyCentral.Domain.RepositoriesImports Kendo.Mvc.UIImports Kendo.Mvc.ExtensionsNamespace Admin.Controllers '<Authorize(Roles:="Administrator")> Public Class UsersController Inherits System.Web.Mvc.Controller Private _uow As IUnitOfWork Public Sub New(uow As IUnitOfWork) If uow Is Nothing Then Throw New ArgumentNullException("uow") End If _uow = uow End Sub ' ' GET: /Admin/Users Function Index() As ActionResult Dim users = _uow.Users.SelectAll().AsEnumerable() Return View("~/Areas/Admin/Views/Users/Index.vbhtml", users) End Function ' ' GET: /Admin/Users/Users_Read Function Users_Read(<DataSourceRequest()> request As DataSourceRequest) As ActionResult Dim users = _uow.Users.SelectAll().AsEnumerable() Return Json(users.ToDataSourceResult(request), JsonRequestBehavior.AllowGet) End Function End Class
End Namespace@ModelType System.Collections.Generic.IEnumerable(Of PropertyCentral.Domain.Entities.User)@Code ViewData("Title") = "Administration/Users" Layout = "~/Views/Shared/_Layout.vbhtml"End Code<div class="widget-box"> <div class="widget-title"> <span class="icon"> <i class="icon-th"></i> </span> <h5>Users</h5> </div> <div class="widget-content nopadding"> @*<div id="userGrid" style="height:380px;"></div> *@ @Code Html.Kendo.Grid(Of PropertyCentral.Domain.Entities.User)(Model) _ .Name("UserGrid") _ .Columns(Sub(column) column.Bound(Function(u) u.UserID) column.Bound(Function(u) u.UserName) column.Bound(Function(u) u.FirstName) column.Bound(Function(u) u.LastName) column.Bound(Function(u) u.EmailAddress) column.Bound(Function(u) u.PhoneNumber) End Sub) _ .DataSource(Sub(dataSource) dataSource _ .Ajax() _ .Read(Sub(read) read.Action("Users_Read", "Users", New With {.Area = "Admin"}) End Sub) End Sub) End Code </div></div>datasource.filter([]);var c = datasource.get(id);c.set("Property", "New Value");datasource.filter([{field: "Property",operator: "==",value: "New Value"}]);