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

PopOver - Load Dynamically?

4 Answers 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Don
Top achievements
Rank 2
Don asked on 27 Jul 2012, 06:58 PM
I am having an odd behavior with the PopOver widget.
I dynamically load a <ul> prior to presenting the page. This works.

However subsequent calls to the same function do not.
I have also noticed this list has to be populated even prior to the page being rendered.

I think these behaviors are related and therefore prohibit (multiple) binding of the list.
Is this correct?

4 Answers, 1 is accepted

Sort by
0
Don
Top achievements
Rank 2
answered on 27 Jul 2012, 07:39 PM
nevermind - I found the problem.

I had 2 elements with the same ID (copy/paste) problem.
I corrected the naming/id and works GREAT !

maybe some help here though: how can we set this value??    
alert( $("#popup").data("popup").height ); // 240

this does not seem to work:
$("#popup").data("kendoMobilePopOver").height = "100";
* but I do have data-popup='{"height": 240, "width": 350}' set declaratively
0
sdobrev
Top achievements
Rank 1
answered on 28 Jul 2012, 10:20 PM
Hi Don,

Have you tried with height jQuery function?
0
Don
Top achievements
Rank 2
answered on 29 Jul 2012, 10:21 PM
yes I have tried that.

I am also experiencing some odd behavior in that click events sometimes fire twice, sometimes not at all.
I have created a jsFiddle app to demonstrate;
http://jsfiddle.net/theDon911/adjHT/
0
Don
Top achievements
Rank 2
answered on 30 Jul 2012, 06:29 PM
ok - I found out what's going on.

When I created my <li>'s dynamically, I bound a click event to the <label> element.
at runtime, 2 separate click events were occuring;
one on the label element initiated by the user,
the other on the <input type=radio> element initiated by Kendo.

my solution is an easy one:
remove all click handlers and add the class="km-listview-label" markup to the (bound) <li>.
This allows the popover to respond to the data-click event in the parent <ul>.

seems simple, huh?

still no luck with resizing though.
Tags
General Discussions
Asked by
Don
Top achievements
Rank 2
Answers by
Don
Top achievements
Rank 2
sdobrev
Top achievements
Rank 1
Share this question
or