Strange behavior for Buttons in a Window

2 posts, 0 answers
  1. Bob
    Bob avatar
    29 posts
    Member since:
    Dec 2014

    Posted 31 Mar 2016 Link to this post

    Strange behavior for Buttons in a Window

    I am having a problem that I am not really sure if it is being caused by something in my KendoUI Windows, my KendoUI Buttons, my JavaScript, or my MVC razor code, but for starters, I am going to post this in both the Button and Window Forums, so please bear with me.

    First, the setup:

    I have an MVC app, which has a main view, with several PartialViews on it.

    2 of the PartialViews have Kendo buttons where each button opens a different Kendo window; 1 of the PartialViews ('View A') has 2 buttons and the other PartialViews ('View B') has 1 button.

    Each of the windows has 3 buttons on it; 'Save', 'Clear', and 'Close'. The code for the buttons and the JavaScript called by them is identical, except, of course, for the object and function names.

    Now, my problems:

    On 1 of the windows from 'View A' and the window from 'View B', all 3 of the buttons do exactly what they are supposed to do; Save the data, Clear the window, or Close the window.

    The second window from 'View A', even though the code is all the same as the others, is exhibiting really strange behavior.

    First time window is opened - the buttons all look like regular Kendo buttons (Buttons_Before.jpg), but NONE of the buttons do anything at all.

    Second time window is opened - the buttons all look like regular Kendo buttons (Buttons_Before.jpg), and the 'Save' and 'Clear' buttons work just fine, BUT the 'Close' button fires the JavaScript twice.

    Any time after the second time the window is opened - the buttons no longer look like Kendo buttons (Buttons_After.jpg) AND they all do nothing at all, again.

    I have tried to use the debugger, but none of the window code shows up there, so I went old school and put in alerts, but they are just telling me the function either fired or didn’t, and most of the time the function doesn’t fire.

    If anyone has any suggestions, I will really appreciate it. None of the other developers around here have been able to help.

    Bob Mathis
  2. Dimo
    Dimo avatar
    8406 posts

    Posted 04 Apr 2016 Link to this post

    Hi Bob,

    The provided information does not give a definite clue what might be the problem, but I would suggest checking for the following:

    - identical IDs of buttons and/or Kendo UI Windows and/or partial view elements, which may lead to duplicate IDs being rendered on the page in a particular scenario

    - loading a partial view inside a Kendo UI Window that is configured to use an iframe, or the opposite - loading a full web page in the Kendo UI Window, instead of a partial view

    - initializing the same Kendo UI Window instance multiple times over the same DOM element

    In case the problem persists and you need further assistance with it, please send us a runnable demo for local testing. Thank you.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top