Hi,
I read many threads about validation in kendo UI, but I don't find what I'm looking for. I have a grid with Custom Popup Editor and AngularJs like this example. When I add a validation in the schema for my grid data source, User cannot save. Because it is a dropdownlist with a default value, required validation does not work. I tried this example for custom validation, but message is not shown. I added this line in the template for popup editor:
<
span
class
=
"k-invalid-msg"
data-for
=
"AssignmentType"
></
span
>
It works for a simple textbox, but not for a dropdownlist.
Any ideas?
Note to Telerik Team: There is many documentation everywhere very nice, but when we use dropdownlist in a grid, it is difficult to find the right way to go.
My two cents
Thank you
5 Answers, 1 is accepted
Hello Steve,
I'm not sure I understood what you mean by "Is it possible to use angular in the save button (called from the custom popup editor) ?" Could you please clarify?
Regards,Rosen
Telerik
Hi,
I found a way to validate in the custom template popup editor (when I set value to dropdownlist to null, I have a message below). However, when I click on Save button in this editor, nothing happen. User does not know what is wrong. So, I tried to manage onSave event on the grid to show a message with all validation errors, but it does not work, because I don't have access to $scope (angular).
Thank you
Hello Steve,
You should be able to access the $scope in the save event depending on how your code is structured. However, you should be able to show custom validation without need to access the scope. Here is a modified version of the custom popup sample which demonstrates a possible implementation. Beside the custom rule you should note the added message placeholder and name attribute of the validated element.
Regards,Rosen
Telerik
Thank you very much for your help. Even if validation was working when I clicked in the dropdownlist (using input.is("[data-bind='value: AssignmentType']")), it was not shown on save click because I didn't put a name to control in the custom template.
Thank you