or
@model sgrc.vpd.home.Models.vwInventory<script> function onSelect(e) { var combobox = $("#ItemType").data("kendoComboBox"); var dataItem = this.dataItem(e.item.index()); alert(dataItem.ItemType + " " + dataItem.TypeID); };</script>@{ ViewBag.Title = "Edit Inventory Item";}@using (Html.BeginForm()){ @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.HiddenFor(model => model.ItemID) @Html.HiddenFor(model => model.VehicleID) @Html.HiddenFor(model => model.memorycard) @Html.HiddenFor(model => model.remarks) @Html.HiddenFor(model => model.signon) @Html.HiddenFor(model => model.signoff) @Html.HiddenFor(model => model.AssignedName) @Html.HiddenFor(model => model.caliber) <div id="tabstrip"> <ul> <li class="k-state-active" > Item Information </li> <li > Assignment Information </li> <li > Vehicle Information </li> </ul> <div id="Item Information"> <div class="edit-field"> <br /> <label for="ItemType" style="color:#212a33">Select Type:</label> @(Html.Kendo().ComboBox() .Name("ItemType") .Placeholder("Select Item Type...") .DataTextField("ItemType") .DataValueField("TypeID") .Filter("contains") .Events(e => e.Select("onSelect")) .DataSource(source => { source.Read(read => { read.Action("GetItems", "Inventory"); }) .ServerFiltering(false); }) ) <label for="Status" style="color:#212a33">Select Status:</label> @(Html.Kendo().ComboBox() .Name("StatusID") .Placeholder("Select Status...") .DataTextField("Status") .DataValueField("StatusID") .Filter("contains") .DataSource(source => { source.Read(read => { read.Action("GetStatus", "Inventory"); }) .ServerFiltering(false); }) ) </div> <div class="edit-field"> @Html.LabelFor(model => model.serialnumber, "Serial Number/VIN") @Html.TextBoxFor(model => model.serialnumber, new { style = "width: 80%; float:right" }) @Html.ValidationMessageFor(model => model.serialnumber) </div> <div class="edit-field"> @Html.LabelFor(model => model.Description, "Description") @Html.TextAreaFor(model => model.Description, new { cols = 83, rows = 5 }) @Html.ValidationMessageFor(model => model.Description) </div> <div class="edit-field"> @Html.LabelFor(model => model.PurchaseDate, "Date Purchased") @Html.EditorFor(model => model.PurchaseDate, new { style = "width: 80%; font-size:18px; font-family:inherit" }) @Html.ValidationMessageFor(model => model.PurchaseDate) @Html.LabelFor(model => model.InServiceDate, "In Service Date", new { style = "color:#212a33" }) @Html.EditorFor(model => model.InServiceDate, new { style = "width: 80%; font-size:18px; font-family:inherit" }) @Html.ValidationMessageFor(model => model.InServiceDate) </div> </div> <div id="Assignment Information"> <div class="edit-field"> <br /> <label for="AssignedID" style="color:#212a33 "width: 80%" >Assigned Officer:</label> @(Html.Kendo().ComboBox() .Name("AssignedID") .DataTextField("FullName") .DataValueField("PersonID") .Placeholder("Select Officer") .DataSource(source => { source.Read(read => { read.Action("GetOfficers", "Inventory"); }) .ServerFiltering(false); }) ) @Html.LabelFor(model => model.AssignedDate, "Date Assigned", new { style = "color:#212a33" }) @Html.EditorFor(model => model.AssignedDate, new { style = "width: 80%; font-size:18px; font-family:inherit" }) @Html.ValidationMessageFor(model => model.AssignedDate) </div> <div class="edit-field" style="width:40%"> <label for="AssignedBy" style="color:#212a33" >Assigned By</label> @(Html.Kendo().ComboBox() .Name("AssignedBy") .DataTextField("FullName") .DataValueField("PersonID") .Placeholder("Select Officer") .DataSource(source => { source.Read(read => { read.Action("GetOfficers", "Inventory"); }) .ServerFiltering(false); }) ) </div> <div class="edit-field"> @Html.LabelFor(model => model.lastupdated, "Last Updated", new { style = "color:#212a33" }) @Html.EditorFor(model => model.lastupdated) @Html.ValidationMessageFor(model => model.lastupdated) @Html.LabelFor(model => model.lastupdatedby, "Last Updated By") @Html.TextBoxFor(model => model.lastupdatedby, new { disabled = "disabled", style = "width: 30%; float:right" }) </div> </div> <div id="Vehicle Information"> <div class="edit-field"> <br /> @Html.LabelFor(model => model.make, "Make", new { style = "color:#212a33" }) @Html.TextBoxFor(model => model.make, new { style = "width: 80%; font-size:18px; font-family:inherit; float:right" }) @Html.ValidationMessageFor(model => model.make) </div> <div class="edit-field"> @Html.LabelFor(model => model.model, "Model", new { style = "color:#212a33" }) @Html.TextBoxFor(model => model.model, new { style = "width: 80%; font-size:18px; font-family:inherit; float:right" }) @Html.ValidationMessageFor(model => model.model) </div> <div class="edit-field"> @Html.LabelFor(model => model.year, "Year", new { style = "color:#212a33" }) @Html.TextBoxFor(model => model.year, new { style = "width: 80%; font-size:18px; font-family:inherit; float:right" }) @Html.ValidationMessageFor(model => model.year) </div> <div class="edit-field"> @Html.LabelFor(model => model.color, "Color", new { style = "color:#212a33" }) @Html.TextBoxFor(model => model.color, new { style = "width: 80%; font-size:18px; font-family:inherit; float:right" }) @Html.ValidationMessageFor(model => model.color) </div> <div class="edit-field"> @Html.LabelFor(model => model.tag, "Tag", new { style = "color:#212a33" }) @Html.TextBoxFor(model => model.tag, new { style = "width: 80%; font-size:18px; font-family:inherit; float:right" }) @Html.ValidationMessageFor(model => model.tag) </div> </div> </div> }<script> $(document).ready(function () { $("#tabstrip").kendoTabStrip({ animation: { open: { effects: "fadeIn" } } }); });</script>@section Scripts { @Scripts.Render("~/bundles/jqueryval")}@(Html.Kendo().Grid<sgrc.vpd.home.Models.vwInventory>() .Name("grid") .Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row)) .Columns(columns => { columns.Bound(dataInventory => dataInventory.serialnumber).Title("Serial#").Width(200); columns.ForeignKey(dataInventory => dataInventory.ItemType, (System.Collections.IEnumerable)ViewData["itemtypes"], "TypeID", "ItemType").Title("Type").Width(250); columns.ForeignKey(dataInventory => dataInventory.StatusID, (System.Collections.IEnumerable)ViewData["status"], "StatusID", "status").Title("Status").Width(250); columns.ForeignKey(dataInventory => dataInventory.AssignedID, (System.Collections.IEnumerable)ViewData["officers"], "PersonID", "FullName") .Title("Assigned To").Width(250); columns.Bound(dataInventory => dataInventory.Description).Title("Description").Hidden(true); //columns.Bound(dataInventory => dataInventory.StatusID).Title("status").Hidden(true); columns.ForeignKey(dataInventory => dataInventory.AssignedBy, (System.Collections.IEnumerable)ViewData["officers"], "PersonID", "FullName") .Title("Assigned By").Width(250); columns.Bound(dataInventory => dataInventory.AssignedDate).Title("Date Assigned").Format("{0:g}"); columns.Bound(dataInventory => dataInventory.ItemID).Hidden(true); columns.Bound(dataInventory => dataInventory.VehicleID).Title("VehicleID").Width(150).Hidden(true); columns.Bound(dataInventory => dataInventory.memorycard).Title("memorycard").Hidden(true); columns.Bound(dataInventory => dataInventory.year).Title("year").Hidden(true); //columns.Bound(dataInventory => dataInventory.status).Title("status").Hidden(true); columns.Bound(dataInventory => dataInventory.make).Title("Make").Hidden(true); columns.Bound(dataInventory => dataInventory.model).Title("Model").Hidden(true); columns.Bound(dataInventory => dataInventory.color).Title("Color").Hidden(true); columns.Bound(dataInventory => dataInventory.tag).Title("Tag").Hidden(true); columns.Bound(dataInventory => dataInventory.signon).Title("Signon").Hidden(true); columns.Bound(dataInventory => dataInventory.signoff).Title("Signoff").Hidden(true); columns.Bound(dataInventory => dataInventory.Ten84).Title("10-84").Format("{0:g}").Hidden(true); columns.Bound(dataInventory => dataInventory.lastupdated).Hidden(true); columns.Bound(dataInventory => dataInventory.lastupdatedby).Title("Updated By:").Hidden(true); //columns.Bound(dataInventory => dataInventory.AssignedID).Title("OfficerID").Hidden(true); columns.Bound(dataInventory => dataInventory.remarks).Title("Remarks").Hidden(true); columns.Bound(dataInventory => dataInventory.PurchaseDate).Title("Purchase Date").Format("{0:MM/dd/yyyy}").Hidden(true); columns.Bound(dataInventory => dataInventory.InServiceDate).Title("In Service Date").Format("{0:MM/dd/yyyy}").Hidden(true); columns.Bound(dataInventory => dataInventory.caliber).Hidden(true); columns.Command(commands => { commands.Edit(); commands.Destroy(); }).Title("Commands").Width(180); }) .ToolBar(toolbar => { toolbar.Create(); // toolbar.Save(); }) .Events(e => e.SaveChanges("onSaveChanges")) //.Events(events => events.Save("onSave")) //.Events(events => events.Edit("onEdit")) .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("EditInventory")) .DataSource(dataSource => dataSource .Ajax() .Events(e => e.Error("onError")) // Handle the "error" event (errors set in controller) .Batch(false) .ServerOperation(false) // Paging, sorting, filtering and grouping will be done client-side .Model(model => { model.Id(dataInventory => dataInventory.ItemID); //model.Field(dataDestruction => dataDestruction.CaseID).Editable(false); }) .Create(create => create.Action("Single_Create", "Inventory")) .Read(read => read.Action("Item_Read", "Inventory")) .Update(update => update.Action("Single_Update", "Inventory")) .Destroy(destroy => destroy.Action("Item_Destroy", "Inventory")) ) .AutoBind(true) .Pageable(page => page.Enabled(true).PageSizes(new[] { 10, 20, 30, 40 })) .Sortable() .Navigatable() //.Scrollable(scrolling => scrolling.Enabled(false)) .Events(e => e.Change("onChange")) //.Filterable() //.Scrollable(scrolling => scrolling.Enabled(true)) //.Scrollable(s => s.Height("auto")) .HtmlAttributes(new {style = "width:960px;"}) .Filterable() )<body> <div id="main"> <div data-role="treeview" data-bind="source: test" data-load-on-demand="true"></div></div> <script>$(document).ready(function() { var MVVM = kendo.observable( { test: new kendo.data.HierarchicalDataSource( { transport: { read: { url: "GetTreeViewData.php" } }, }), }); kendo.bind($('#main'), MVVM); }); </script></body><?php $result = []; $item = new stdClass(); $item->text = "level 1.1"; $result[] = $item; $item = new stdClass(); $item->text = "level 1.2"; $item->items = []; $subitem = new stdClass(); $subitem->text = "level 2.1"; $item->items[] = $subitem; $subitem = new stdClass(); $subitem->text = "level 2.2"; $item->items[] = $subitem; $item = new stdClass(); $item->text = "level 1.3"; $result[] = $item; header('Content-type: application/json;'); echo json_encode($result); ?><select ...k-template="'<b>#: displayName #</b><br/>#: name #'"k-value-template="'#: displayName #'"></select><select ...k-template="'<b>{{dataItem.displayName}}</b><br/>{{dataItem.name}}'"k-value-template="'{{dataItem.displayName}}'"></select>01.// Variables02.var SPSite = "https://cerfich.sharepoint.com";03. 04.// Wait for Icenium to load05.document.addEventListener("deviceready", onDeviceReady, false);06. 07.function onDeviceReady() {08. 09. // Authenticate against SharePoint server10. SPOAuth(SPSite);11. 12. // Initialize ListView13. $("#listview").kendoMobileListView({14. pullToRefresh: true15. });16. 17. // apply the bindings18. kendo.bind($("#ListSPItems"), VMListSPItems);19.}01.var VMListSPItems = kendo.observable({02. 03. // Hold SharePoint list items04. GetCustomers: function(e)05. {06. var Customers = GetAllCustomers(SPSite);07. Customers.success(function(data){08. // Get Value from SharePoint09. var AllCustomers = null;10. AllCustomers = data.d.results;11. 12. // Update data13. VMListSPItems.set("GetCustomers", AllCustomers);14. });15. },16.});01.<div data-role="view" id="ListSPItems" data-title="Customers List" data-layout="mobile-tabstrip">02. <div id="CustomersError" />03. 04. <ul id="listview" data-bind="source: GetCustomers" data-template="itemTemplate"></ul>05. 06. <script id="itemTemplate" type="text/x-kendo-template">07. <li><a> ${data.Title} </a></li>08. </script>09. </div>01.function GetAllCustomers(siteurl)02.{ 03. return $.ajax({04. url: siteurl + "/_api/lists/getByTitle('Customers')/items",05. type: "GET",06. headers: {07. "ACCEPT": "application/json;odata=verbose"08. },09. //success: function (data) 10. //{11. // //array = data.d.results;12. // Customers = data.d.results;13. //},14. error: function(xhr, ajaxOptions, thrownError){15. //var message = xhr.responseText.find("message").text();16. var message = xhr.responseText;17. $("#CustomersError").html(message);18. }19. });20.}UnitPrice: { type: "number", validation: { required: true, min: 0.01, step:0.01} },