Popover prevent hide on click outside

0 Answers 336 Views
Popover
Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
Vedad asked on 27 Mar 2023, 02:40 PM

Hi,

I am using kendo popover to display some dynamic messages in my app.

I show kendo popover based on my local event and display message. I want it to stay visible until user specifically uses "close" action button within the popover.

However, whatever I do, the moment user clicks outside popover, it is closed. 

My page consists from header bar (not visible or same for pages), and I want to "anchor" my popover to it. So, when it's there, popover should appear and remain visible. 

For obvious reasons, I can't make my whole page to be container, because it makes no sense.

I tried preventing default on hide event, but result is the same.

Please could you tell me how to do this? I easily achieved this on popover for angular.

 

Thank you in advance.

Regards,

Vedad

Nikolay
Telerik team
commented on 30 Mar 2023, 10:22 AM

Hi Vedad,

The Kekdno UI Popover inherits from the Popup thus you need to use Popup's events to prevent the closing.

show: function(e) {
              e.sender.wrapper.data("kendoPopup").bind("close", function(e) {
                if(toClose) {
                 e.preventDefault(); //prevent popup closing
                }
              });
            },
            actions: [
              {
                text: "Close",
                click: function (e) {
                  console.log("close")
                  toClose = false
                  e.sender.wrapper.data("kendoPopup").close()
                  toClose = true
                }
              }]

Dojo demo: https://dojo.telerik.com/eYOtiXED

Please let me know if you have any questions.

Regards,

Nikolay

 

No answers yet. Maybe you can help?

Tags
Popover
Asked by
Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
Share this question
or