var movies = [ {
title: "Star Wars: A New Hope",
year: 1977
}, {
title: "Star Wars: The Empire Strikes Back",
year: 1980
}, {
title: "Star Wars: Return of the Jedi",
year: 1983
}
];
var localDataSource = new kendo.data.DataSource({data: movies});
function mobileListViewPullToRefresh() {
var dataSource = new kendo.data.DataSource({
serverPaging: true,
pageSize: 10,
transport: {
read: {
url: "json.txt",
dataType: "json" // JSONP (JSON with padding) is required for cross-domain AJAX
},
},
schema: { // describe the result format
data: "results" // the data which the data source will be bound to is in the "results" field
}
});
$("#pull-to-refresh-listview").kendoMobileListView({
dataSource: dataSource,
pullToRefresh: true,
appendOnRefresh: false,
template: $("#pull-to-refresh-template").text(),
endlessScroll: false,
pullParameters: function(item) {
return {
since_id: item.id_str,
page: 1
};
}
});
}
function getStoreDS() {
return new kendo.data.DataSource
({
error : error,
schema: {
data: "d",
model: {
id: "IdStore",
fields: {
IdStore: { editable: false, nullable: true, type: "numeric" }
Name: { editable: true, type: "string", nullable: false },
IdCity: { editable: true, nullable: true, type: "numeric" },
City: { editable: true, nullable: true, type: "string" },
IdStoreType: { editable: true, nullable: false, type: "numeric" },
StoreType: { editable: true, nullable: false, type: "string" },
Code1: { editable: true, nullable: true, type: "string" },
Code2: { editable: true, nullable: true, type: "string" },
Code3: { editable: true, nullable: true, type: "string" },
}
}
},
transport: {
read: { url: "WCF/Store.svc/GetStores", contentType: "application/json; charset=utf-8", type: "POST" },
create: { url: "WCF/Store.svc/AddStore", contentType: "application/json; charset=utf-8", type: "POST" },
update: { url: "WCF/Store.svc/UpdateStore", contentType: "application/json; charset=utf-8", type: "POST" },
destroy: { url: "WCF/Store.svc/DeleteStore", contentType: "application/json; charset=utf-8", type: "POST" },
parameterMap: function(data, operation) {
if (operation != "read") {
data.IdCountry = $("#country").val();
return kendo.stringify({ store: data })
}
else {
//$("#grid").kendoAnimate({ effects: "slide:down fade:out", show: true });
return kendo.stringify({ IdCountry: $("#country").val() })
}
}
}
}); }
@(Html.Kendo().Grid<CrossReferenceMapDataViewModel>() .Name("MappingGrid") .Columns(columns => { columns.ForeignKey(row => row.DataSource, new SelectList(new[]{ new {text="CPDP",value = "1"}, new {text="GXS",value = "2"}, new {text="Terminal",value = "3"}, }, "value", "text")).Title("Data Source"); if (@ViewBag.crossReferenceMapColumnsList != null) { foreach (CrossReferenceMapColumnViewModel availableColumn in @ViewBag.crossReferenceMapColumnsList) { switch (availableColumn.XrefDataColumnName) { case "DATA01": columns.Bound(row => row.Data01).Title(availableColumn.ColumnName + " (" + (availableColumn.Direction.ToString() == "Input" ? "from" : "to") + ")"); break; case "DATA02": columns.Bound(row => row.Data02).Title(availableColumn.ColumnName + " (" + (availableColumn.Direction.ToString() == "Input" ? "from" : "to") + ")"); break; case "DATA03": columns.Bound(row => row.Data03).Title(availableColumn.ColumnName + " (" + (availableColumn.Direction.ToString() == "Input" ? "from" : "to") + ")"); break; case "DATA04": columns.Bound(row => row.Data04).Title(availableColumn.ColumnName + " (" + (availableColumn.Direction.ToString() == "Input" ? "from" : "to") + ")"); break; case "DATA05": columns.Bound(row => row.Data05).Title(availableColumn.ColumnName + " (" + (availableColumn.Direction.ToString() == "Input" ? "from" : "to") + ")"); break; } } } columns.Command(row => { if (SecurityHelper.UserCanEdit(UserFeature.CrossReferenceDataMapping, Context)) { row.Edit().HtmlAttributes(new {@name = "btnGridRowEdit"}); } else { row.Custom("hdnE").HtmlAttributes(new { style = "display:none" }); } if (SecurityHelper.UserCanDelete(UserFeature.CrossReferenceDataMapping, Context)) { row.Destroy().HtmlAttributes(new {@name = "btnGridRowDelete"}); } else { row.Custom("hdnD").HtmlAttributes(new { style = "display:none" }); } }).Title("Actions"); }) .Pageable() .Sortable() .Scrollable() .AutoBind(false) .Filterable() .Editable(editable => editable.Mode(GridEditMode.InLine)) .ToolBar(toolBar => { if (SecurityHelper.UserCanAdd(UserFeature.CrossReferenceDataMapping, Context)) { toolBar.Create() .HtmlAttributes(new { @id = "btnCreateMapping" }); } toolBar.Custom() .Text("Export To Excel") .HtmlAttributes(new { @id = "btnExport" }) .Url(UrlMaker.ToCrossReferenceDataMappingExport()); }) .DataSource(dataSource => dataSource .Ajax() .Events(e => e.Error("onError")) .Read(reader => reader.Action("Read", "CrossReferenceDataMapping").Data("additionalData")) .Create(reader => reader.Action("Create", "CrossReferenceDataMapping").Data("additionalData")) .Update(reader => reader.Action("Update", "CrossReferenceDataMapping")) .Destroy(reader => reader.Action("Destroy", "CrossReferenceDataMapping")) .Model(model => model.Id(row => row.MapDataId)) ) )@(Html.Kendo().Menu().Name("Menu") .Items(items => { items.Add().Text("Products") .Items(children => { children.Add().Text("Furniture"); }); items.Add().Text("Stores") .Content(@<text> @(Html.Kendo().PanelBar().Name("panelbar").ExpandMode(PanelBarExpandMode.Multiple) .HtmlAttributes( new { style = "width: 300px" }) .Items(panelbar => { panelbar.Add().Text("My TeamMates") .Items(it => { it.Add().Text("First"); it.Add().Text("Second"); }); }) ) </text>); }))
<%@ Page Title="" Language="C#" MasterPageFile="~/mobile.master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="index" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div data-role="view" data-init="mobileListViewPressToLoadMore" data-title="Patient List"> <header data-role="header"> <div data-role="navbar"> <span data-role="view-title"></span> <a data-align="right" data-role="button" class="nav-button" href="#index">Index</a> </div> </header> <ul id="load-more"></ul></div><script> function mobileListViewPressToLoadMore() { var dataSource = new kendo.data.DataSource({ pageSize: 20, serverPaging: true, transport: { read: { url: "http://myservices/rest/plan.svc/Patient" // the remove service url }, parameterMap: function(options) { var parameters = { q: "javascript", //additional parameters sent to the remote service rpp: options.pageSize, page: options.page //next page }; return parameters; } }, schema: { // describe the result format data: "" // the data which the data source will be bound to is in the "results" field } }); $("#load-more").kendoMobileListView({ dataSource: dataSource, template: $("#load-more-template").text(), loadMore: true }); }</script><script id="load-more-template" type="text/x-kendo-template"> <div class="tweet"> <div class="metadata"> <a class="sublink" target="_blank" href="http://#= id #" rel="nofollow">#= first_name + ' ' + last_name #</a> | <a class="sublink" href="http://#= mrn #" rel="nofollow">#= pat_seqno #</a> </div> </div></script><style scoped> .tweet { font-size: .8em; line-height: 1.4em; } .pullImage { width: 64px; height: 64px; border-radius: 3px; float: left; margin-right: 10px; } .sublink { font-size: .9em; font-weight: normal; display: inline-block; padding: 3px 3px 0 0; text-decoration: none; opacity: .8; }</style></asp:Content>