Show Handler Lost Inside of Popover

2 posts, 0 answers
  1. Kelly
    Kelly avatar
    73 posts
    Member since:
    Apr 2011

    Posted 17 Mar 2014 Link to this post

    Hello,

    Are view events handled differently for views that are children of popovers?  I set up the following PopOver.  The PopOver is opened by a function in the underlying view from code, passing a valid target. It works consistently, meaning the popover can be opened and closed over and over with no problems.  However, the function "popupshow" defined in the view's data-show attribute is only called the first time the PopOver is opened.  In the debugger, I have verified that the view's show function is still pointing to the correct function - it is just not called ever again after the first open.

    Here is the popover:

    <div id="login-popover" data-role="popover" data-popup='{ "height": "220", "width": "250" }' data-close="reset">
         <div  data-role="view" data-title="Login" data-model="logins" data-init="logins.popupinit" data-show="logins.popupshow">
             <div id="login-wrapper" data-role="content">
                 <form id="login-form">
                     <input type="email" id="username" data-bind="value: info.username" placeholder="EMAIL"/>
                     <input type="password" id="pwd" data-bind="value: info.password" placeholder="PASSWORD"/>
                     <div>
                         <span class="k-invalid-msg" data-for="username"></span>
                     </div>
                     <div>
                         <a data-role="button" data-click="login">Login</a>                               
                         <a data-role="button" data-click="register">Sign Up</a>
                     </div>
                 </form>                       
             </div>
         </div>
     </div>

    I open using this call:

    $("#login-popover").data("kendoMobilePopOver").open("#valid-element");

    and close with either this call:

    $("#login-popover").data("kendoMobilePopOver").close();

    or by simply tapping outside of the PopOver.  The "reset" function in the data-close does nothing but change the class of an unrelated visual element.  The "reset" is called consistently, too, no matter how many times the popover is opened.  Only the show goes away.  Any ideas would be appreciated.

    Thank you,

    Kelly


  2. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 19 Mar 2014 Link to this post

    Hello Kelly,

    The behavior you describe is by design. The inner popover view itself is unaware of the popover being shown/hidden. The init/show events are called the first time the popover is displayed, since its contents are initialized at that moment. 

    As you have correctly noticed, you can rely on the popover open/close events to reliably track when the popover is toggled.

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top