Files
2022-11-04 13:24:24 +02:00

143 lines
5.0 KiB
HTML
Executable File

<!DOCTYPE html>
<html>
<head>
<title>Layout</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">
<div class="demo-section k-content">
<h4>Grid Layout</h4>
<div id="validation-success"></div>
<form id="exampleform"></form>
</div>
<script>
$(document).ready(function () {
var validationSuccess = $("#validation-success");
$("#exampleform").kendoForm({
formData: {
FirstName: "John",
LastName: "Doe",
Email: "[email protected]",
Country: "1",
City: "Strasbourg",
AddressLine: ""
},
layout: "grid",
grid: {
cols: 2,
gutter: 20
},
items: [
{
type: "group",
label: "Personal Information",
layout: "grid",
grid: { cols: 1, gutter: 10},
items: [
{
field: "FirstName",
label: "First Name:",
validation: { required: true }
},
{
field: "LastName",
label: "Last Name:",
validation: { required: true }
},
{
field: "Email",
label: "Email",
validation: {
required: true,
email: true
}
}
]
},
{
type: "group",
label: "Shipping Address",
layout: "grid",
grid: { cols: 2, gutter: 10 },
items: [
{
field: "Country",
editor: "DropDownList",
label: "Country",
validation: { required: true },
colSpan: 1,
editorOptions: {
optionLabel: "Select...",
dataSource: [
{ Name: "France", Id: 1 },
{ Name: "Germany", Id: 2 },
{ Name: "Italy", Id: 3 },
{ Name: "Spain", Id: 4 }
],
dataTextField: "Name",
dataValueField: "Id"
}
},
{
field: "City",
label: "City",
validation: { required: true },
colSpan: 1,
},
{
field: "AddressLine",
label: "Address Line",
colSpan: 2,
validation: { required: true }
},
]
}
],
validateField: function(e) {
validationSuccess.html("");
},
submit: function(e) {
e.preventDefault();
validationSuccess.html("<div class='k-messagebox k-messagebox-success'>Form data is valid!</div>");
},
clear: function(ev) {
validationSuccess.html("");
}
});
});
</script>
</div>
<style>
#example .k-content {
max-width: 600px;
width: 600px;
}
</style>
</body>
</html>