Kendo ui Multitask

Does anyone know how to test the Kendo Multiselect UI widget using the Kendo UI validator?
I just want to check if the selection contains something or is empty.
Must require Multiselect.

thanks

+6
source share
1 answer

Given the multi selector, defined as:

<select id="tags" multiple="multiple" name="tags" required data-required-msg="Select start time"></select> 

and the following JavaScript to initialize it:

 var multi = $("#tags").kendoMultiSelect({ dataSource: { transport: { read: function (op) { var data = [ "Option1", "Option2", "Option3", "Option4", "Option5" ]; op.success(data); } } } }).data("kendoMultiSelect"); 

Add the following code to verify it:

 // Get reference to the validator var validator = $("#tags").kendoValidator().data("kendoValidator"); // Bind validation to blur $("input", multi.wrapper).on("blur", function() { validator.validate(); }); 
+10
source

Source: https://habr.com/ru/post/945174/


All Articles