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

Closable dialog navigates to #

1 Answer 67 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
KonnectRD
Top achievements
Rank 1
KonnectRD asked on 27 Sep 2016, 01:00 PM

Hi,

I have a problem using the KendoUI Dialog component :
When a Dialog is closable, the X button appears on the dialog, and when I click on it, the browser navigates to '#'. After looking in the code, when you create the button, (which is a <a> link), you set the href to #, which causes the navigation. Is there any way to disable this navigation or redefine the link ?

Demonstration of the problem :

Go to : http://demos.telerik.com/kendo-ui/dialog/api#, click edit this example, run the code in dojo, open the dialog and close it by clicking the X button on the top right.

Thanks

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 27 Sep 2016, 02:10 PM
Hello Patrick,

To stop the navigation when an anchor tag is clicked, you can call the jQuery method preventDefault():

https://api.jquery.com/event.preventdefault/

$(".k-dialog-close").on('click', function(e){
  e.preventDefault();
})

Kind Regards,
Alex
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
General Discussions
Asked by
KonnectRD
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or