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

popover acts like not initialized

2 Answers 177 Views
PopOver (Mobile)
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 11 Oct 2012, 02:34 PM
Have an anchor:
<a id="popanchor" data-rel="popover" href="#popover-task" data-role="button" >Open PopOver</a>

and a popover:
<div data-role="popover" id="popover-task" >
    <div data-role="view">
        Hi There
    </div>
</div>

Other kendo elements seem to be working fine. Get error when clicking on the button "Uncaught TypeError: Cannot call method 'openFor' of undefined".

Looking at source the error occurs here:
kendo.widgetInstance($(href), ui).openFor(link);

In the widgetInstance function...
kendo.widgetInstance = function(element, suite) {
    var widget = suite.roles[element.data(kendo.ns + "role")];
 
    if (widget) {
        return element.data("kendo" + widget.fn.options.prefix + widget.fn.options.name);
    }
};

it fails to find the "kendoMobilePopOver" data. Which leads me to believe its not initializing properly. I tried setting up in in JavaScript instead and same result.

Thoughts? Thanks,

Dennis

2 Answers, 1 is accepted

Sort by
0
Accepted
Kamen Bundev
Telerik team
answered on 15 Oct 2012, 02:47 PM
Hello Dennis,

Can you post bigger code snippet - its hard to deduce what is wrong from this one? Generally the PopOver widget is meant to be a child of a View and can be referenced only within the said View. Maybe this is the issue you're facing?

Greetings,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dennis
Top achievements
Rank 1
answered on 15 Oct 2012, 06:12 PM
That's exactly the issue. Doh! And not only does it need to be child of the view, in the case of the SplitView I needed to put it child to the view inside the pane... Thanks Kamen.
Tags
PopOver (Mobile)
Asked by
Dennis
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Dennis
Top achievements
Rank 1
Share this question
or