or
var viewModel = kendo.observable({ Name : null, Properties : []});viewModel.set("Name", $object.Name);viewModel.set("Properties", $object.Properties);using Kendo.Mvc.UI;
using System.Data;
using System.Linq;
using System.Web.Mvc;
public class EventViewModel : ISchedulerEvent
{
//... getters and setters
}
public class SchedulerEventService : ISchedulerEventService<EventViewModel>{ public virtual void Insert(EventViewModel task, ModelStateDictionary modelState) { //... code emitted } public virtual void Delete(EventViewModel appointment, ModelStateDictionary modelState) { //... code emitted } public virtual IQueryable<EventViewModel> GetAll() { //... code emitted } public virtual void Insert(EventViewModel appointment, ModelStateDictionary modelState) { //... code emitted } public virtual void Update(EventViewModel appointment, ModelStateDictionary modelState) { //... code emitted }}
(function ($) { $.printJSON = function(value){ return JSON.stringify(value, undefined, 2); }})(jQuery);var viewModel = kendo.observable({ // other fields etc update: function (e) { e.preventDefault(); $("#json_result").html($.printJSON(this)); }});<div style="width: 400px; float: left; padding-left: 15px;" > <button data-bind="click: update" value="Update" >Update</button> <pre id="json_result"> </pre></div><script type="text/x-kendo-template" id="notificationListTemplate">
<a class="faqListQuestion" href="${url}" data-rel="external" >${title}<br /><span class="notificationDates">${date}</span></a>
</script>
Is there something wrong with my template or some other workaround for this issue?@(Html.Kendo().MultiSelect() .Name("Fields") .DataTextField("Name") .DataValueField("Id") .Value(ViewData["tagslist"] as IEnumerable<int>) .Filter(FilterType.Contains) .Placeholder("...") .Events(e => { e.Change("change_field"); }) .DataSource(source => { source.Read(read => { read.Action("ShowFields", "Folders"); }); })<div id="tree"> @( Html.Kendo().TreeView() .Name("treeview") .ExpandAll(true) .TemplateId("treeview-template") .DragAndDrop(true) .BindTo(Model) .Events(events => events .DragEnd("onDragEnd") ) )
</div>public ActionResult Index(IEnumerable<int> fieldTags,int id = 1 ){ IEnumerable<TreeViewItemModel> kendoModel = new List<TreeViewItemModel>(); SopFolder kendoStartFolder = db.SopFolders.Where(r => r.Id == id).Take(1).Select(r => r).ToList()[0]; kendoModel = CreateKendoTree(kendoStartFolder, fieldTags); var SopFields = db.SopFields .Select(r => new { Value = r.Id, Text = r.Name }); List<int> tagslist = new List<int>(); foreach(var tag in SopFields) { tagslist.Add(tag.Value); } ViewData["tagslist"] = tagslist; if (Request.IsAjaxRequest()) { return PartialView("_Tree", kendoModel); } return View(kendoModel);}