Kendo UI View Events not triggered when used in Layout

2 posts, 0 answers
  1. Matthias
    Matthias avatar
    1 posts
    Member since:
    Mar 2015

    Posted 09 Apr 2015 Link to this post

    <div id="wms-app"></div>
     
    <script>
      var router, layout;
       
        var loginView = new kendo.View("view-login", { show: function(e){
                                                            alert("login");
                                                            $('input').keypress(function(event) {
                                                                if(event.which == 10 || event.which == 13) {
                                                                    event.preventDefault();
                                                                    window.location = document.getElementById('textButton').href;
                                                                }
                                                            });
                                                       }, wrap: false });  
         
        // setup layout
        layout = new kendo.Layout("layout-template1", { show: function(e){
                                                            alert("temp");
                                                            var pN = document.getElementById("wms-content").parentNode;
                                                            pN.style = "height:100%";
                                                        } });
       
        layout.render("#wms-app");
     
        // define a default view
        layout.showIn("#wms-content", loginView);
         
        // define a router with a basic routes
        router = new kendo.Router();
    </script>
       
    <script id="view-login" type="text/x-kendo-template">
        <div id="loginBox">
            <div id="login-header">
                LAPS
            </div>
     
            <input id='inputuser' class="k-textbox one-edge-shadow" placeholder="Username"></input>
            <input id='inputpasswd' type="password" class="k-textbox one-edge-shadow" placeholder="Password"></input>
             
            <a id="textButton" class="k-button one-edge-shadow" href="#/main">LOGIN</a>
        </div>
    </script>
       
    <script id="layout-template1" type="text/x-kendo-template">
        <div id="wms-content"></div>
    </script>

     

     The alert for the layout gets triggerd but the alert for the view not! why??

     

    Thank you

  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 10 Apr 2015 Link to this post

    Hi,

    your script generates a javascript error (missing parentNode), which terminates the rest of the script execution, including the view alert. 

    Regards,
    Petyo
    Telerik
     
    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
Back to Top