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

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

8 Answers 157 Views
ModalView
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 2
Iron
Jack asked on 15 Nov 2012, 06:23 PM
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>

8 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 16 Nov 2012, 08:32 AM
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!
0
Jack
Top achievements
Rank 2
Iron
answered on 16 Nov 2012, 09:58 AM
IMO, this is a strange design option because one would expect the open event to be triggered consistently however the widget is opened.
0
Richard
Top achievements
Rank 1
answered on 26 Aug 2013, 03:24 AM
Agree with Jack. It caused us lot of pain to try handle it before open the view.
0
Kiril Nikolov
Telerik team
answered on 28 Aug 2013, 10:54 AM
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!
0
Ainsley
Top achievements
Rank 1
answered on 10 Oct 2014, 07:25 PM
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.
0
Kiril Nikolov
Telerik team
answered on 13 Oct 2014, 08:44 AM
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!
 
0
Grzegorz
Top achievements
Rank 1
answered on 03 Oct 2017, 10:15 AM
In the latest version still the same. I also wasted hour to identify where problem is. Can we count on a quick solution to this?
0
Nencho
Telerik team
answered on 06 Oct 2017, 08:15 AM
Hello Grzegorz,

I am afraid that the manual handling of the events, when they are trigger manually from the API is obligatory throughout the entire suite and products behavior. There are several exceptions in some specific scenarios, however, generally you should manually handle the events, as previously described in this thread. 

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ModalView
Asked by
Jack
Top achievements
Rank 2
Iron
Answers by
Petyo
Telerik team
Jack
Top achievements
Rank 2
Iron
Richard
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Ainsley
Top achievements
Rank 1
Grzegorz
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or