I'm just starting a project using PHP, rather than my more familiar ASP.NET MVC.
I'm trying to get a grid with a pop-up editor working, containing a field bound to a drop-down list. I've (finally) got this working, but even though I've added the required validation to the field, and the field in the table is not nullable, the form is still allowing blank entries, which are populated as ''.
The field is defined as:-
$monthField
=
new
\Kendo\Data\DataSourceSchemaModelField(
'Month'
);
$monthField
->type(
'string'
)
->validation(
array
(
'required'
=>true));
The column is :-
$monthColumn
=
new
\Kendo\UI\GridColumn();
$monthColumn
->field(
'Month'
)
->editor(
'monthDropDownEditor'
);
and the validator is set up as:-
function
monthDropDownEditor(container, options) {
$(
'<input data-text-field="Month" data-value-field="Month" data-bind="value:'
+ options.field +
'"/>'
)
.appendTo(container)
.kendoDropDownList({
autoBind:
false
,
dataSource: {
schema: {
data:
"data"
},
transport: {
read: {
url:
"dataSourceMonths.php?type=read"
,
type:
"POST"
,
dataType:
"json"
}
}
},
optionLabel:
"Select month..."
,
});
}
What do I need to do to make this a required field, and pop-up a validation message?
Thanks