Closable dialog navigates to #

2 posts, 0 answers
  1. KonnectRD
    KonnectRD avatar
    1 posts
    Member since:
    Feb 2016

    Posted 27 Sep 2016 Link to this post


    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 :, click edit this example, run the code in dojo, open the dialog and close it by clicking the X button on the top right.


  2. Alex Hajigeorgieva
    Alex Hajigeorgieva avatar
    318 posts

    Posted 27 Sep 2016 Link to this post

    Hello Patrick,

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

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

    Kind Regards,
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top