or
@(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);} $('#lookupDataGrid').data('kendoGrid').dataSource.transport.read.data ={"UserLookupTableID":123};console.log($('#lookupDataGrid').data('kendoGrid').dataSource.transport.read.data); // outputs correct object $('#lookupDataGrid').data('kendoGrid').dataSource.read();var url = '.../lookup-tables/get-lookup-data?UserLookupTableID=123;$('#lookupDataGrid').data('kendoGrid').dataSource.transport.read.url = url;$('#lookupDataGrid').data('kendoGrid').dataSource.read();
{ "Id": null, "Name": "Test Item", "Prototypes": [ { "Id": "items/prototypes/shield", "Name": "Shield", "Mutations": [ { "Name": "Shield", "Measurement": 4, "Statistic": { "Id": "statistics/damage-reduction-physical", "Name": "Damage Reduction/Physical" } }, { "Name": "Shield", "Measurement": 15, "Statistic": { "Id": "statistics/health", "Name": "Health" } } ], "Consumable": false, "Equipable": true, "Tags": [ { "Id": "tags/shielding", "Name": "Shielding", "Description": "This is capable of somehow shielding the user, either with mitigation or abilities" } ] } ]}<div data-role="listview" style="margin: 0px;" data-template="templates-admin-inherited-prototypes" data-bind="source: Prototypes"></div><script type="text/html" id="templates-admin-inherited-prototypes"> <h2 data-bind="text: Name"></h2> <div data-template="templates-admin-inherited-mutation" data-bind="source: Mutations"></div> </script><script type="text/html" id="templates-admin-inherited-mutation"> ${ Statistic.Name }</script> var rankList = [ { value: 1, text: "Rank 1" }, { value: 2, text: "Rank 2" }, { value: 3, text: "Rank 3" }, { value: 4, text: "Rank 4" }, { value: 5, text: "Rank 5" } ];$kendoGrid.columns.filter(function (item) { return item.field === "Rank"; }).forEach(function (item) { item.values = rankList; }); //reset the grids columns $kendoGrid.setOptions({ columns: $kendoGrid.columns }); $kendoGrid.refresh();.Columns(columns =>{ columns.Bound(p => p.UserAccountKey); columns.Bound(p => p.FirstName); columns.Bound(p => p.LastName); columns.Bound(p => p.EmailAddress); columns.Bound(p => p.Rank); columns.Command(command => { command.Edit(); command.Destroy(); });})