javascript - KendoUI Custom Command Popup : ReferenceError: wnd is not defined -


i trying popup window using custom command;

 $(document).ready(function(){         var wnd, detailstemplate;         $("#grid").kendogrid({             datasource:{                 serverpaging: true,                 transport: {                     read: "<?php echo base_url() ?>index.php/user_management/manage_users/list_view/"                 },                 schema:{                     data: "data",                     total: "total"                 },                 pagesize:5             },             scrollable: true,             selectable: true,             sortable: true,             filterable: true,             pageable: {                 input: true,                 numeric: false             },              columns: [                 {                     field: "userid",                     hidden:true                 },                 {                     field: "username",                     title:"username"                 },                 { field: "firstname",                     title:"first name"                 },                 {field:"middlenames"},                 {field:"lastname"},                 {field:"city"},                 {field:"email"},                 //{field:"actions"},                 {command: { text: "details", click: showdetailspopup }, title: " ", width: "140px" }             ]           });         wnd = $("#details")                 .kendowindow({                     title: "customer details",                     modal: true,                     visible: false,                     resizable: false,                     width: 300                 }).data("data");         detailstemplate = kendo.template($("#template").html());       });      function showdetailspopup(e) {         e.preventdefault();         var dataitem = this.dataitem($(e.currenttarget).closest("tr"));         wnd.content(detailstemplate(dataitem));         wnd.center().open();     } 

but when click on "details" button in grid, see error in firebug;

referenceerror: wnd not defined [break on error]     wnd.center().open(); 

updated: here template

<script type="text/x-kendo-template" id="template">         <div id="details-container">             <h2>#= firstname #</h2>         </div> </script> 

please make correction .data("data"):

wnd = $("#details")             .kendowindow({                 title: "customer details",                 modal: true,                 visible: false,                 resizable: false,                 width: 300            ** }).data("data");**     detailstemplate = kendo.template($("#template").html());   }); 

it should .data("kendowindow") below;

wnd = $("#details")             .kendowindow({                 title: "customer details",                 modal: true,                 visible: false,                 resizable: false,                 width: 300            }).data("kendowindow");     detailstemplate = kendo.template($("#template").html()); }); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -