Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cascaded dropdowns validation tooltip is shown initially in Kendo editor edit form #2166

Closed
mparvanov opened this issue Sep 15, 2016 · 4 comments

Comments

@mparvanov
Copy link
Contributor

mparvanov commented Sep 15, 2016

Bug report

Cascaded dropdowns validation tooltip is shown initially in Kendo editor edit form

Reproduction of the problem

Use the setup for Kendo Grid handling cascading dropdownlists with popup from the following sample project:
https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/grid-editing-cascading-dropdownlist
Open the first grid Edit form by clicking on the Add button

Current behavior

The cascaded dropdowns validation tooltip is shown initially

Expected/desired behavior

The cascaded dropdowns validation tooltip is not shown initially

Video of the reproduction: http://screencast.com/t/RizV7BF7LW

Environment

Kendo UI version: The issue is reproduced since Q1 2016

@mparvanov mparvanov changed the title Cascaded dropdowns validation tooltip is shown in Kendo editor edit form Cascaded dropdowns validation tooltip is shown initially in Kendo editor edit form Sep 15, 2016
@ggkrustev
Copy link
Contributor

@mparvanov @IvanDanchev The described behavior is expected, although not very intuitive. It is caused by this feature:

The desire to support the model synchronization properly won over the unintuitive 'error message'.

I am afraid that I cannot think of any workaround that could overcome the discussed issue. Pull requests with a proper solution are always accepted though :).

@danail-vasilev
Copy link
Contributor

@danielkaradachki suggested to workaround that behavior by making the model fields nullable.

@ggkrustev
Copy link
Contributor

I would close this issue with Won't fix as the behavior is intended (described in #661)

@Vince-31
Copy link

Vince-31 commented Oct 5, 2018

In case anyone is still searching, as this is the only suggested result on google, here's my workaround.

You can bind the "onValidateInput" event of a validator to a handler which hides the error message if the control to validate is disabled. This gets you the same behavior as in earlier versions of Kendo.

//Bind the validateInput event of the validator
//Here I'm within a grid edit pop-up so I used getKendoValidator()
container.getKendoValidator().bind("validateInput", _me.onValidateInput);
//Handler that hides the error messages
function onValidateInput(e)  {
        if (e.input[0].disabled) {
            $(e.input[0]).next(".k-widget.k-tooltip-validation").each(function () { $(this).hide() });
        }
        else if (!e.valid) {
            $(e.input[0]).next(".k-widget.k-tooltip-validation").each(function () { $(this).show() });
        }
 };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants