Items.colSpan
configurationDefines the field size when grid layout is used. A fixed number defines the colspan for the form field. An array is used to map the colSpan to responsive breakpoints.
items.colSpan
Number|Array<script>
$("#myForm").kendoForm({
formData: {
ID: 1,
FirstName: "John",
LastName: "Doe",
Address: "London",
Postcode: "SW1A 1AA"
},
layout:"grid",
grid: {
cols: 2,
gutter: 20
},
items: [{
type: "group",
label: "Personal Information",
layout: "grid",
grid: {
cols: 6,
gutter: 10
},
items:[{
field: "FirstName",
label: "First Name:",
validation: { required: true },
colSpan: [{
maxWidth: 600,
value: 2
},
{
minWidth: 601,
maxWidth: 1000,
value: 4
}]
},{
field: "LastName",
label: "Last Name:",
validation: { required: true },
colSpan: 4
}]
},{
type: "group",
label: "Shipping Address",
layout: "grid",
colSpan: 2,
grid: {
cols: 4,
gutter: 10
},
items:[{
field: "Address",
label: "Address:",
colSpan: 2,
},{
field: "Postcode",
label: "Postcode:",
colSpan: 2
}]
}]
});
</script>
items.colSpan.maxWidth
NumberDefines the maximum width in pixels for which the specific breakpoint colSpan value will be applied.
<script>
$("#myForm").kendoForm({
formData: {
ID: 1,
FirstName: "John",
LastName: "Doe",
Address: "London",
Postcode: "SW1A 1AA"
},
layout:"grid",
grid: {
cols: 2,
gutter: 20
},
items: [{
type: "group",
label: "Personal Information",
layout: "grid",
grid: {
cols: 6,
gutter: 10
},
items:[{
field: "FirstName",
label: "First Name:",
validation: { required: true },
colSpan: [{
maxWidth: 600,
value: 2
},
{
minWidth: 601,
maxWidth: 1000,
value: 4
}]
},{
field: "LastName",
label: "Last Name:",
validation: { required: true },
colSpan: 4
}]
},{
type: "group",
label: "Shipping Address",
layout: "grid",
colSpan: 2,
grid: {
cols: 4,
gutter: 10
},
items:[{
field: "Address",
label: "Address:",
colSpan: 2,
},{
field: "Postcode",
label: "Postcode:",
colSpan: 2
}]
}]
});
</script>
items.colSpan.minWidth
NumberDefines the minimum width in pixels for which the specific breakpoint colSpan value will be applied.
<script>
$("#myForm").kendoForm({
formData: {
ID: 1,
FirstName: "John",
LastName: "Doe",
Address: "London",
Postcode: "SW1A 1AA"
},
layout:"grid",
grid: {
cols: 2,
gutter: 20
},
items: [{
type: "group",
label: "Personal Information",
layout: "grid",
colSpan: 2,
grid: {
cols: 6,
gutter: 10
},
items:[{
field: "FirstName",
label: "First Name:",
validation: { required: true },
colSpan: 2
},{
field: "LastName",
label: "Last Name:",
validation: { required: true },
colSpan: 4
}]
},{
type: "group",
label: "Shipping Address",
layout: "grid",
colSpan: 2,
grid: {
cols: 4,
gutter: 10
},
items:[{
field: "Address",
label: "Address:",
colSpan: 2,
},{
field: "Postcode",
label: "Postcode:",
colSpan: 2
}]
}]
});
</script>
items.colSpan.value
NumberDefines the colSpan value that will be applied when the width of the form meets the breakpoint criteria.
<script>
$("#myForm").kendoForm({
formData: {
ID: 1,
FirstName: "John",
LastName: "Doe",
Address: "London",
Postcode: "SW1A 1AA"
},
layout:"grid",
grid: {
cols: 2,
gutter: 20
},
items: [{
type: "group",
label: "Personal Information",
layout: "grid",
colSpan: 2,
grid: {
cols: 6,
gutter: 10
},
items:[{
field: "FirstName",
label: "First Name:",
validation: { required: true },
colSpan: 2
},{
field: "LastName",
label: "Last Name:",
validation: { required: true },
colSpan: 4
}]
},{
type: "group",
label: "Shipping Address",
layout: "grid",
colSpan: 2,
grid: {
cols: 4,
gutter: 10
},
items:[{
field: "Address",
label: "Address:",
colSpan: 2,
},{
field: "Postcode",
label: "Postcode:",
colSpan: 2
}]
}]
});
</script>