Grid
configurationGrid layout settings.
grid
Object<form id="myForm"></form>
<script>
$(document).ready(function () {
$("#myForm").kendoForm({
formData: {
FirstName: "John",
LastName: "Doe",
Email: "john.doe@email.com",
Phone: "123-456-7890",
Address: "123 Main St"
},
layout: "grid",
grid: {
cols: [1, 2],
gutter: {
cols: 20,
rows: 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 }
}, {
field: "Phone",
label: "Phone:"
}, {
field: "Address",
label: "Address:"
}]
});
});
</script>
grid.cols
Number|ArrayA number defines the columns of the grid. When an array is used it is used to map the columns to the provided responsive breakpoints.
<form id="myForm"></form>
<script>
$("#myForm").kendoForm({
formData: {
ID: 1,
Name: "Ivan",
Address: "Sofia"
},
layout: "grid",
grid: {
cols: 2,
gutter: 10,
rows: 1
},
items: [{
field: "Name",
label: "Name:"
}, {
field: "Address",
label: "Address:"
}]
});
</script>
<form id="myForm"></form>
<script>
$("#myForm").kendoForm({
formData: {
ID: 1,
Name: "Ivan",
Address: "Sofia"
},
layout: "grid",
grid: {
cols: [{
maxWidth: 600,
value: 2
},
{
minWidth: 601,
maxWidth: 800,
value: 3
},
{
minWidth: 801,
maxWidth: 2800,
value: 4
}],
gutter: 10,
rows: 1
},
items: [{
field: "Name",
label: "Name:"
}, {
field: "Address",
label: "Address:"
}]
});
</script>
grid.gutter
Number|String|ObjectDefines the width of the gutters between the columns / rows.
<form id="myForm"></form>
<script>
$(document).ready(function () {
$("#myForm").kendoForm({
formData: {
FirstName: "John",
LastName: "Doe",
Email: "john.doe@email.com",
Phone: "123-456-7890"
},
layout: "grid",
grid: {
cols: 2,
gutter: {
cols: 20,
rows: 15
}
},
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 }
}, {
field: "Phone",
label: "Phone:"
}]
});
});
</script>
Related Members
- grid.cols - A number defines the columns of the grid. When an array is used it is used to map the columns to the provided responsive breakpoints.
- grid.gutter - Defines the width of the gutters between the columns / rows.
- grid.gutter.rows - Defines the width of the gutters between the rows. When an array is used, it is mapped to set the gutter between the rows for the provided responsive breakpoints.
- grid.gutter.cols - Defines the width of the gutters between the columns. When an array is used, it is mapped to set the gutter between the columns for the provided responsive breakpoints.