BUG: data-open handler not triggered when open method is used to show the modal view

7 posts, 0 answers
  1. Jack
    Jack avatar
    100 posts
    Member since:
    Jan 2007

    Posted 15 Nov 2012 Link to this post

    The following sample is self explanatory and I would be surprised if it were by design:
    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
        <script src="http://code.jquery.com/jquery-1.8.2.min.js" type="text/javascript"></script>
        <script src="http://cdn.kendostatic.com/2012.3.1114/js/kendo.all.min.js" type="text/javascript"></script>
    </head>
    <body>
    <div data-role="view">
        <a data-role="button" href="#foo" data-rel="modalview">This triggers logTarget</a>
        <a data-role="button" data-click="open">This does not trigger logTarget</a>
        <div id="console"></div>
    </div>
    <div data-role="modalview" id="foo" data-open="logTarget">
        This is a simple modal view
    </div>
    <script>
        $(function(){
            new kendo.mobile.Application();
        });
     
        function open(e) {
            var modalView = $('#foo').data('kendoMobileModalView');
            modalView.open();
        }
     
        function logTarget(e) {
            $('#console').append('logTarget Triggered');
        }
    </script>
    </body>
    </html>
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 16 Nov 2012 Link to this post

    Hi,

    Yes, this decision is by design - the API calls do not trigger events. The reason behind that is that the developer doing the API call would be aware of the open happening, and can call the event handler manually. 

    Kind regards,
    Petyo
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Jack
    Jack avatar
    100 posts
    Member since:
    Jan 2007

    Posted 16 Nov 2012 Link to this post

    IMO, this is a strange design option because one would expect the open event to be triggered consistently however the widget is opened.
  5. Richard
    Richard avatar
    24 posts
    Member since:
    May 2012

    Posted 25 Aug 2013 Link to this post

    Agree with Jack. It caused us lot of pain to try handle it before open the view.
  6. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 28 Aug 2013 Link to this post

    Hello Guys,

    I will forward your feedback to our developers, so they can consider it in the future.
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  7. Ed
    Ed avatar
    7 posts
    Member since:
    Dec 2009

    Posted 10 Oct 2014 in reply to Kiril Nikolov Link to this post

    So the only purpose is having data-before-open and data-open is to give the developer the option to e.preventDefault()?  This doesnt make sense to me and I spent a great deal of time today thinking my code was buggy. 

    I agree with the others that this is confusing and should operate similarly to other views and API calls.
  8. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 13 Oct 2014 Link to this post

    Hi Gene,

    Thank you for contacting us and sharing your feedback.

    I will add your feedback to the already created feedback topic, so it will be considered for future implementation. 

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready