jQuery UI Widgets Forums Dialogs and Notifications Tooltip, Notification, Popover Invalid Popover toggler: "[object Object]"

This topic contains 7 replies, has 2 voices, and was last updated by  Drakonos 6 years, 3 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author

  • Drakonos
    Participant

    Hello,

    i have tried to insert a popover to an selfmade button in animateCC. i made the button like everytime and insert the following code

    $(“#jqxPopoverTodesfallHinweis1”).jqxPopover({
    offset: {
    left: -50,
    top: 0
    },
    theme: ‘arctic’,
    arrowOffsetValue: 50,
    title: “Test”,
    showCloseButton: true,
    selector: $(“#btnTodesfallHinweis1”)
    });

    the selector is my button-id and the “jqxPopoverTodesfallHinweis1” is the div with the information (the note). but i get the error
    Invalid Popover toggler: “[object Object]”

    what is the issue for this?

    greetz

    Michel


    Martin
    Participant

    Hello Michel,

    This error is usually thrown when the jqxPopover selector is invalid.
    This issue may come because of the custom button that you are using.
    Try to put the button in a parent div and pass this div’s id to the selector.

    If this doesn’t resolve your issue you can send us your code so we can look at it.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/


    Drakonos
    Participant

    Hello,

    first, i create a div like

    window.Popover_Todesfall_Hinweis_1_Element = document.createElement(‘div’); //create a Div
    Popover_Todesfall_Hinweis_1_Element.id = ‘jqxPopoverTodesfallHinweis1’; //set its ID
    canvas.parentNode.appendChild(Popover_Todesfall_Hinweis_1_Element);

    second, i created a custom button with the id “btnTodesfallHinweisEins”
    this button is in a movieclip, because i can not create a div in a movieclip.
    Only over the mvc the div is useable.

    and third, added a eventlistener for the custom button

    exportRoot.mvcTodesfallProgramm.btnTodesfallHinweisEins.addEventListener(“click”, onClickHinweis.bind(this));

    function onClickHinweis(e) {

    $(“#jqxPopoverTodesfallHinweis1”).jqxPopover({
    offset: {
    left: -50,
    top: 0
    },
    theme: ‘mobile’,
    arrowOffsetValue: 50,
    title: “Test”,
    showCloseButton: true,
    selector: e.currentTarget.name,
    });
    }

    hope you can help me.

    greetz

    Michel


    Martin
    Participant

    Hello, Michel!

    Try using this as a selector: $('#' + e.target.id), instead of e.currentTarget.name.

    Also in your code you create the popover again and again on each click of the button. Add a check if it is already created:

    function onClickHinweis(e) {
         if(!($("#jqxPopoverTodesfallHinweis1").jqxPopover('selector'))){
             $("#jqxPopoverTodesfallHinweis1").jqxPopover({
                offset: {left: -50, top:0}, 
                arrowOffsetValue: 50, 
                title: "Employees", 
                showCloseButton: true, 
                selector: $('#' + e.target.id)});
             $('#jqxPopoverTodesfallHinweis1').jqxPopover('open');
         }
     }

    If the content of the popover is displayed in the beginning before the first button click you can set its css to display: none.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/


    Drakonos
    Participant

    Hello Martin,

    i tried your solution, and now i get a
    Uncaught Error: Invalid Selector – #btnTodesfallHinweisEins! Please, check whether the used ID or CSS Class name is correct.
    (i changed the id from the custom button)


    Drakonos
    Participant

    sorry, for double post but, i cant edit.

    i copied your solution into my script and get the invalid popover toggler error again.

    i think it is not possible to use this widget with the animate cc. The listbox is funktional but the popover is strange to use.


    Martin
    Participant

    Hello Drakonos,

    Yes, it is possible that the issue is coming from the animate cc.
    Please, take a look at this Example. Here the popover’s selector is the id of the button’s parent div.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/


    Drakonos
    Participant

    Hello,

    your solution and the standard squared button from animate cc let me open the popover. a custom button brings me the error. maybe i can customize the layout from the starndard button from animate, so thx for your help.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.