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

Show Handler Lost Inside of Popover

1 Answer 53 Views
PopOver (Mobile)
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 17 Mar 2014, 07:56 PM
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


1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 19 Mar 2014, 09:38 AM
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!
 
Tags
PopOver (Mobile)
Asked by
Kelly
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or