Custom validations does not work in kendo ui grid update

3 posts, 1 answers
  1. Rasika
    Rasika avatar
    18 posts
    Member since:
    Jul 2015

    Posted 03 Sep 2015 Link to this post

    Here I add custom validation. Here is the code. But it don't give error message.
    What should I do for it ??
  2. Answer
    Viktor Tachev
    Admin
    Viktor Tachev avatar
    2213 posts

    Posted 04 Sep 2015 Link to this post

    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!
     
  3. Rasika
    Rasika avatar
    18 posts
    Member since:
    Jul 2015

    Posted 07 Sep 2015 in reply to Viktor Tachev Link to this post

    Thank you !!!
Back to Top