My window Test

by chanaka1

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.default.min.css">
<script src="http://cdn.kendostatic.com/2011.3.1129/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.common.min.css">
<div id="window">
 </div>

<span id="undo" class="k-button">Click here to open the window.</span>
<script id="scriptTemplate" type="text/x-kendo-template">
    
    <div>
    <table cellspacing="0" cellpadding="0" border="0" width="325">
  <tr>
    <td>
       <table cellspacing="0" cellpadding="2" border="2" width="500" >
         <tr>
            <th >firstName</th>
            <th>lastName</th>
         </tr>
       </table>
    </td>
  </tr>
  <tr>
    <td>
       <div style="width:525px; height:100px; overflow:auto;">
         <table cellspacing="0" cellpadding="1" border="1" width="500" >        
             # for (var i = 0; i < data.length; i++) { #
             <tr>
             <td><li>#= data[i] #</li></td>
             <td><li>#= data[i] #</li></td>
             </tr>
             # } #
         </table>  
       </div>
    </td>
  </tr>
</table>
    </div>
</script>

JavaScript

$(document).ready(function() {
                    var window = $("#window"),
                        undo = $("#undo")
                                .bind("click", function() {
                                    window.data("kendoWindow").open();
                                    undo.hide();
                                });
  
                    var onClose = function() {
                        undo.show();
                    }

                    if (!window.data("kendoWindow")) {
                        window.kendoWindow({
                            width: "600px",
                            actions: ["Custom", "Minimize", "Maximize", "Close"],
                            title: "Test",
                            visible: false,
                            close: onClose
                        });
                    }
                  
                  var scriptTemplate = kendo.template($("#scriptTemplate").html());
                  var scriptData = { firstName: "John", lastName: "Doe", pagesize:"5" };
                  var scriptData = ["John","Doe","5" ];
                  $("#window").html(scriptTemplate(scriptData));

                });