mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-02 09:25:40 +00:00
236 lines
7.7 KiB
HTML
Executable File
236 lines
7.7 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Editing</title>
|
|
<meta charset="utf-8">
|
|
<link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.common.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.mobile.min.css" rel="stylesheet">
|
|
<script src="../../js/jquery.min.js"></script>
|
|
<script src="../../js/jszip.min.js"></script>
|
|
<script src="../../js/kendo.all.min.js"></script>
|
|
<script src="../content/shared/js/console.js"></script>
|
|
<script>
|
|
|
|
</script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<a class="offline-button" href="../index.html">Back</a>
|
|
|
|
<div id="example">
|
|
|
|
<a class="k-button k-button-icontext k-add-button" href="#"><span class="k-icon k-i-add"></span>Add new record</a>
|
|
<div id="listView"></div>
|
|
<div id="pager" class="k-pager-wrap"></div>
|
|
|
|
<script type="text/x-kendo-tmpl" id="template">
|
|
<div class="product-view k-widget">
|
|
<dl>
|
|
<dt>Product Name</dt>
|
|
<dd>#:ProductName#</dd>
|
|
<dt>Unit Price</dt>
|
|
<dd>#:kendo.toString(UnitPrice, "c")#</dd>
|
|
<dt>Units In Stock</dt>
|
|
<dd>#:UnitsInStock#</dd>
|
|
<dt>Discontinued</dt>
|
|
<dd>#:Discontinued#</dd>
|
|
</dl>
|
|
<div class="edit-buttons">
|
|
<a class="k-button k-edit-button" href="\\#"><span class="k-icon k-i-edit"></span></a>
|
|
<a class="k-button k-delete-button" href="\\#"><span class="k-icon k-i-close"></span></a>
|
|
</div>
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/x-kendo-tmpl" id="editTemplate">
|
|
<div class="product-view k-widget">
|
|
<dl>
|
|
<dt>Product Name</dt>
|
|
<dd>
|
|
<input type="text" class="k-textbox" data-bind="value:ProductName" name="ProductName" required="required" validationMessage="required" />
|
|
<span data-for="ProductName" class="k-invalid-msg"></span>
|
|
</dd>
|
|
<dt>Unit Price</dt>
|
|
<dd>
|
|
<input type="text" data-bind="value:UnitPrice" data-role="numerictextbox" data-type="number" name="UnitPrice" required="required" min="1" validationMessage="required" />
|
|
<span data-for="UnitPrice" class="k-invalid-msg"></span>
|
|
</dd>
|
|
<dt>Units In Stock</dt>
|
|
<dd>
|
|
<input type="text" data-bind="value:UnitsInStock" data-role="numerictextbox" name="UnitsInStock" required="required" data-type="number" min="0" validationMessage="required" />
|
|
<span data-for="UnitsInStock" class="k-invalid-msg"></span>
|
|
</dd>
|
|
<dt>Discontinued</dt>
|
|
<dd><input type="checkbox" name="Discontinued" data-bind="checked:Discontinued"></dd>
|
|
</dl>
|
|
<div class="edit-buttons">
|
|
<a class="k-button k-update-button" href="\\#"><span class="k-icon k-i-check"></span></a>
|
|
<a class="k-button k-cancel-button" href="\\#"><span class="k-icon k-i-cancel"></span></a>
|
|
</div>
|
|
</div>
|
|
</script>
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
var crudServiceBaseUrl = "https://demos.telerik.com/kendo-ui/service",
|
|
dataSource = new kendo.data.DataSource({
|
|
transport: {
|
|
read: {
|
|
url: crudServiceBaseUrl + "/Products",
|
|
dataType: "jsonp"
|
|
},
|
|
update: {
|
|
url: crudServiceBaseUrl + "/Products/Update",
|
|
dataType: "jsonp"
|
|
},
|
|
destroy: {
|
|
url: crudServiceBaseUrl + "/Products/Destroy",
|
|
dataType: "jsonp"
|
|
},
|
|
create: {
|
|
url: crudServiceBaseUrl + "/Products/Create",
|
|
dataType: "jsonp"
|
|
},
|
|
parameterMap: function(options, operation) {
|
|
if (operation !== "read" && options.models) {
|
|
return {models: kendo.stringify(options.models)};
|
|
}
|
|
}
|
|
},
|
|
batch: true,
|
|
pageSize: 4,
|
|
schema: {
|
|
model: {
|
|
id: "ProductID",
|
|
fields: {
|
|
ProductID: { editable: false, nullable: true },
|
|
ProductName: "ProductName",
|
|
UnitPrice: { type: "number" },
|
|
Discontinued: { type: "boolean" },
|
|
UnitsInStock: { type: "number" }
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
$("#pager").kendoPager({
|
|
dataSource: dataSource
|
|
});
|
|
|
|
var listView = $("#listView").kendoListView({
|
|
dataSource: dataSource,
|
|
template: kendo.template($("#template").html()),
|
|
editTemplate: kendo.template($("#editTemplate").html())
|
|
}).data("kendoListView");
|
|
|
|
$(".k-add-button").click(function(e) {
|
|
listView.add();
|
|
e.preventDefault();
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
.product-view
|
|
{
|
|
float: left;
|
|
width: 50%;
|
|
height: 300px;
|
|
box-sizing: border-box;
|
|
border-top: 0;
|
|
position: relative;
|
|
}
|
|
.product-view:nth-child(even) {
|
|
border-left-width: 0;
|
|
}
|
|
.product-view dl
|
|
{
|
|
margin: 10px 10px 0;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
}
|
|
.product-view dt, dd
|
|
{
|
|
margin: 0;
|
|
padding: 0;
|
|
width: 100%;
|
|
line-height: 24px;
|
|
font-size: 18px;
|
|
}
|
|
.product-view dt
|
|
{
|
|
font-size: 11px;
|
|
height: 16px;
|
|
line-height: 16px;
|
|
text-transform: uppercase;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.product-view dd
|
|
{
|
|
height: 46px;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
.product-view dd .k-widget,
|
|
.product-view dd .k-textbox {
|
|
font-size: 14px;
|
|
}
|
|
#example .k-listview
|
|
{
|
|
border-width: 1px 0 0;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
min-height: 298px;
|
|
}
|
|
.edit-buttons
|
|
{
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
text-align: right;
|
|
padding: 5px;
|
|
background-color: rgba(0,0,0,0.1);
|
|
}
|
|
.k-pager-wrap
|
|
{
|
|
border-top: 0;
|
|
}
|
|
span.k-invalid-msg
|
|
{
|
|
position: absolute;
|
|
margin-left: 6px;
|
|
}
|
|
|
|
.k-add-button {
|
|
margin-bottom: 2em;
|
|
}
|
|
|
|
media only screen and (max-width : 620px) {
|
|
|
|
.product-view
|
|
{
|
|
width: 100%;
|
|
}
|
|
.product-view:nth-child(even) {
|
|
border-left-width: 1px;
|
|
}
|
|
}
|
|
</style>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|