or
$("#treeview").data("kendoTreeView").dataSource.data()<!DOCTYPE html><html><head> <title>My App</title> <link href="css/kendo.mobile.all.min.css" rel="stylesheet" /></head><body> <div data-role="view" data-layout="default"> Hello Mobile World! </div> <div data-role="view" id="about" data-title="About"> About this app. </div> <div data-role="layout" data-id="default"> <header data-role="header"> <div data-role="navbar">My App</div> </header> <!-- View content will render here --> <footer data-role="footer"> <div data-role="tabstrip"> <a href="#">Home</a> <a href="#about">About</a> </div> </footer> </div> <script src="js/jquery.min.js" type="text/javascript"></script> <script src="js/kendo.mobile.min.js" type="text/javascript"></script> <script> var app = new kendo.mobile.Application(); </script></body></html><input data-role='numerictextbox' data-format='n9' data-min='0' data-decimals='9'
{ command: { text: "Unwind", click: showUnwind }, title: " ", width: "50px" },
function showUnwind(e) { e.preventDefault(); var dataItem = this.dataItem($(e.currentTarget).closest("tr")); var selImagineSNum = dataItem["ImagineSNum"]; var direction = _rootUrl + "CFD/GetUnwindWindowContent/" + selImagineSNum; var wnd = $("#unwindWindow").data("kendoWindow"); if (!wnd) { // first click of the button - will automatically fetch the contentUrl wnd = $("#unwindWindow").kendoWindow({ title: "Unwind Trade", actions: ["Minimize", "Maximize", "Close"], content: direction, width: "800px", height: "600px", visible: false, modal: true }).data("kendoWindow"); } wnd.refresh(direction); wnd.center(); wnd.open(); }
4. The CFDUnwind.init() method is in CFD.Unwind.js and that file is of course already loaded. The code is:@{ Layout = null; } <div style="margin: 5px 5px 0 5px;"> @* Header *@ <table class="table table-condensed"> <tr><th>PrcmNum</th><th>ImagineSNum</th><th>PrimeBroker</th><th>Fund</th><th>Trade Date</th><th>Setl. Date</th></tr> <tr><td>@ViewBag.Id</td><td>@ViewBag.Id</td><td>PrimeBroker</td><td>Fund</td><td>01/01/2012</td><td>01/02/2012</td></tr> </table> @* Grid *@ <p class="help-block">Associated trades based on: Fund, Prime Broker & PrcmNum</p> <div id="gridAssoc"></div> </div> <script type="text/javascript"> CFDUnwind.init(); /* $(function () { CFDUnwind.init(); }); */ </script>
var CFDUnwind = {}; CFDUnwind._assocTradesDataSource = null; // *** Initialize the CFD partial view CFDUnwind.init = function () { // ** DataSource for the CFD Trades CFDUnwind._assocTradesDataSource = new kendo.data.DataSource({ transport: { read: { type: "POST", url: _rootUrl + "CFD/GetAssocCFDTradesPOST", dataType: "json" } }, schema: { model: { id: "ImagineSNum", fields: { Confirmed: { editable: true, type: "boolean" }, PrcmNum: { editable: false, type: "number" }, ImagineSNum: { editable: false, type: "number" }, Fund: { editable: false, type: "string" }, Strategy: { editable: false, type: "string" }, Folder: { editable: false, type: "string" }, Name: { editable: false, type: "string" } } } } }); // ** Grid widget $("#gridAssoc").kendoGrid({ dataSource: CFDUnwind._assocTradesDataSource, navigatable: true, selectable: "single", height: 280, resizable: true, sortable: { mode: "single", allowUnsort: false }, columns: [ { field: "Confirmed", title: "✓", width: 15, template: '<input type="checkbox" #= Confirmed ? checked="checked" : "" # ></input>' }, { field: "PrcmNum", title: "PrcmNum", width: 45 }, { field: "ImagineSNum", title: "ImagineSNum", width: 45 }, { field: "Fund", title: "Fund", width: 55 }, { field: "Strategy", title: "Strategy", width: 55 }, { field: "Folder", title: "Folder", width: 55 }, { field: "Name", title: "Instr. Name", width: 60 } ], dataBound: function (e) { // console.log("gridAssoc dataBound event"); } }); }
$(document).ready(function () { $("#grid").kendoGrid({ dataSource: { type: 'odata', transport: { read: { url: "http://localhost:13059/api/Addressbook", contentType: "application/json; charset=utf-8", dataType: "json", type:"GET", data: {} }, parameterMap: function (options, type) { var paramMap = kendo.data.transports.odata.parameterMap(options); delete paramMap.$inlinecount; // <-- remove inlinecount parameter. delete paramMap.$format; // <-- remove format parameter. //paramMap.$includeTotalCount= "True"; return paramMap; } }, success: function (e) { alert("Success: " + e.error); }, error: function (e) { debugger; alert("Error: " + e.errorThrown); }, change: function (e) { // alert("Change"); }, requestStart: function (e) { //alert("Request Start"); }, schema: { data: function (data) { return data.Results; // <-- The result is just the data, it doesn't need to be unpacked. }, total: function (data) { // return data.length; // <-- The total items count is the data length, there is no .Count to unpack. return data.TotalResults; }, model: { fields: { Country_Code: { type: "string" }, Country_ID: { type: "number" }, Country_Name: { type: "string" }, County_Desc: { type: "string" } } } }, pageSize: 1, //serverPaging: true, // serverFiltering: true, // serverSorting: true }, height: 250, filterable: true, sortable: true, pageable: true }); });