Kendo ModalView Events

by kendomobile

HTML

<script src="http://cdn.kendostatic.com/2013.2.716/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.2.716/styles/kendo.mobile.all.min.css">
<!-- Demo created for the book: Building Mobile Applications Using Kendo UI Mobile andASP.NET Web API.
http://www.packtpub.com/building-mobile-applications-with-kendoui-html5/book -->
<div data-role="view">
    <a data-rel="modalview"
       href="#myModalView" 
       data-role="button">
       Open Modal View
    </a>
</div>

 <div data-role="modalview" data-open="modalViewOpen" 
      data-close="modalViewClose" data-height="200px"
      data-width="300px"id="myModalView">
         
    <a style="float:right" data-click="closeModalView"
       data-role="button">
           Close Me !
    </a>          
    <h2> I am a modal view... </h2>         
</div>

JavaScript

var app = new kendo.mobile.Application(document.body);

function modalViewOpen(e){
    
   alert('widget opened');
}

function modalViewClose(e){
    alert('widget closed');
}

function closeModalView(e){
 $("#myModalView").data("kendoMobileModalView").close();
}