This is a migrated thread and some comments may be shown as answers.

Custom validations does not work in kendo ui grid update

2 Answers 10 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rasika
Top achievements
Rank 1
Rasika asked on 03 Sep 2015, 05:38 AM
Here I add custom validation. Here is the code. But it don't give error message.
What should I do for it ??

2 Answers, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 04 Sep 2015, 02:16 PM
Hi Rasika,

In order for the message to be displayed you need to ensure that the data- attribute of the input includes the name of the validation function.

UnitsInStock: {
    type: "number",
    validation: { unitValidations: function(input){
                                        if ((input.val() <= 1000) && (input.val() >= 10)) {
                                            return true;
                                        } else {
                                            input.attr("data-unitValidations-msg","value must in given range");
                                            return false ;
                                        }
                                     
                                        return true ;
                                    },
                                required: true
    }
}


Check out the modified dojo sample below.



Regards,
Viktor Tachev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Rasika
Top achievements
Rank 1
answered on 07 Sep 2015, 05:12 AM
Thank you !!!
Tags
Grid
Asked by
Rasika
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Rasika
Top achievements
Rank 1
Share this question
or