在这部分代码中,我尝试将Kendo验证器与kendo multiselect集成。
var validator = $("#form" + $scope.field).kendoValidator({
messages: {
required: function () {
if (typeof $scope.validationMessage == 'undefined')
return 'This field is required';
return $scope.validationMessage
,
}
}).data("kendoValidator")
$scope.MultiSelectOptions = {
placeholder: $scope.placeholder,
dataTextField: 'model',
dataValueField: 'model',
dataSource: $scope.currentEntityDataSource,
};
我的HTML
<select kendo-multi-select
ng-class="$parent.inputClass()"
id="{{$parent.field}}"
ng-model="$parent.$parent.config.selectedData[field]"
k-options="MultiSelectOptions"></select>
这对我来说似乎很好,但验证消息从未出现过。 我用kendo-date-time尝试相同的代码并且有效!