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

Gird custom validation

2 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Praneeth
Top achievements
Rank 1
Praneeth asked on 22 Aug 2013, 03:10 PM
The problem is that when using a custom validation in the Kendo UI Grid for with a single editable column in IE 9 and 10 the validation message seems to get duplicated for the following use-case,

Please refer to the following JSFiddle - http://jsfiddle.net/praneethw/j9D8Q/2/

1. Wait for the grid to load.
2. Click on the editable column "Allocated"
3. Delete the content.
4. Click on a different row.
5. Click back in the Textbox and notice the duplicate warning message.

I need to enable a few custom validations and this seems to be blocking me at the moment when using with IE
I would greatly appreciate you quick response please with a resolution or work around please.

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 23 Aug 2013, 11:52 AM
Hi Praneeth,

The issue occurs because the custom validation is evaluated for each input in the validator container. The numeric text box has two inputs which is why the validator validates them both and message pop ups twice.

The solution is to include logic that will check if the input that is being validated is the correct one.
validIP: function (input1) {
    if(input1.is("[data-role='numerictextbox']")) {
        input1.attr('data-validIP-msg', 'Invalid allocation');
        return $.isNumeric(input1.val());
    } else {
        return true;  
    }
}


For your convenience I updated the jsFiddle sample:
I hope this will help.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Praneeth
Top achievements
Rank 1
answered on 23 Aug 2013, 12:47 PM
Many thanks Alexander! It works perfectly!!
Tags
Grid
Asked by
Praneeth
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Praneeth
Top achievements
Rank 1
Share this question
or