<div id="view"> Sites Monitored: <div data-bind="html: sitesMonitored" ></div><br/> Sites Failing: <div data-bind="html: sitesFailing" ></div></div>var viewModel = kendo.observable({ sitesMonitored: 0, sitesFailing: 0});var dataSource = new kendo.data.DataSource({ transport: { read: "/Dashboard/Stats", type: "get" }});{"SitesMonitored":35,"SitesFailing":4}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)) ) )