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

Kendo UI Error on Grid Custom Validation

5 Answers 359 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Guilherme
Top achievements
Rank 1
Guilherme asked on 24 Jan 2014, 04:45 PM
Hello, we found an error related with Grid and Validator.

Validation is not triggered sometimes on a grid edit box after editing a custom validation cell with backspace.
Reproduced on Firefox v26.0, using page http://demos.kendoui.com/web/grid/editing-custom-validation.html.

1 - Load the URL
2 - Click on “Add new record”
3 - Enter “aAbc” on ProductName
4 - Hit TAB and change focus to Unit Price. Validation message shows up stating that “ProductName should start with capital letter”.
5 - Hit Shift+TAB to return to ProductName field.
6 - Use left arrow on keyboard to place the cursos after “a” and hit backspace.
7 - Hit TAB to change focus again to Unit Price.
8 - At this moment, validation seems to not be triggered at 100% of times and the error message is still shown to the user.
9 - Although it is noticed less often, the same issue can be reproduced when the whole field is re-entered, instead of simply hitting backspace/delete.

Please check the image attached for an example.

Additional information about the error:
It is actually not a result of editing with backspace or delete.
The problem can be reproduced also when you re-type the complete string and set that to the same valid value it had previously.
For example, type in the demo Abc, switch fields, ProductName validates OK. Switch back, change ProductName to aAbc, switch field, ProductName is marked incorrect. Switch back, type in Abc again, switch field, error message is still present.

What happens is that the datasource model is not updated when the validation fails. So in the last time, when you enter the correct value, it probably compares to the last correct value it has on the model. As it is exactly the same as you have now on the UI control, the validation is not run.
It seems to be a consequence of some optimization that is attempted on the validation framework.

Regards

5 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 28 Jan 2014, 04:47 PM
Hi Guilherme,

You are right that the dataSource model is not updated, when the validation fails, and that when the correct value is entered again the change event of the model is not triggered - as practically there is no change in the model (the 1st and 3rd values entered are the same). While you still see the message, the form is correctly validated and if you press"Update" the values will be stored correctly in the grid. 

If you enter a value that differs from the first one, the validator will validate correctly and not display the error message.  

The way this functionality is implemented at the moment we think is the most optimal, so we are planning a change.

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
John
Top achievements
Rank 1
answered on 19 Feb 2014, 11:36 PM
I wonder if this could be the source of a problem we are experiencing with grid edits and updates.  We are using a grid, bound to a DataSource, which uses a template for popup editing and which has custom validation attached.  We are using a template because we need password form inputs, and we are using custom validation for both redundant password verification and to verify username uniqueness server-side via ajax.  When a grid record edit button is clicked, the popup form opens with all bound inputs displaying the appropriate values.

When edited, we have to initially invalidate the username until the server response comes back with the uniqueness result.  If uniqueness succeeds, we call the validation again.  On the second pass, if the input matches the verified value (cached), we return true as the validation result.  All is working as expected, and the invalid notification (processing message) is cleared.

However, when we submit the form, the POST value for username is not the modified/verified value, but the original value of username.  The form input contains/displays (correctly) edited text.

Any suggestions how to overcome this issue?
0
Kiril Nikolov
Telerik team
answered on 20 Feb 2014, 11:19 AM
Hello John,

Please open a new thread/support request and attach a sample project where this exact problem is reproduced, so we can take a deeper look.

Thank you for your cooperation.

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Thierry
Top achievements
Rank 1
answered on 02 Sep 2015, 10:04 AM

We reproduce this custom validation problem.

I would like to know if there is any fix date and/or package available.

If not, is there any workaround to enforce the validate function or to enforce the datasource update ?

 

Regards

Thierry 

0
Kiril Nikolov
Telerik team
answered on 03 Sep 2015, 11:14 AM

Hello Thierry,

 

Can you send us the sample where you have reproduced the issue in a separate support ticket, so we can investigate it?

 

Thanks for the cooperation.

 

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Guilherme
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
John
Top achievements
Rank 1
Thierry
Top achievements
Rank 1
Share this question
or