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

Open window where content source contains template

1 Answer 749 Views
Window
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 07 Aug 2012, 10:08 AM
I'm trying to open a window where content page has uses a template to display the data.
The content page it self works fine just entering the url but when I try to open it as a window nothing happens.
     var window = $("#window");
    
   window.kendoWindow({
        width: "505px",
        height: "315px",
        title: "Mail",
        actions: ["Refresh", "Maximize", "Close"],
        content:"inbox/getemail.aspx?msgid="+msgid,
        iframe:false
    });
 
    window.data("kendoWindow").open();

//content page 
script language="javascript">
 
var messageData;
 
$.fn.getMessageData = function(){
     
    messageData =
    {      
        time:'2012-07-26 12:34:50',
        sender:'test@test.com',
        subject:'Testing message data'     
    };
};
 
$(function(){  
    var template = kendo.template($("#template").html());
    $.fn.getMessageData();     
    $("#preview").html(template(messageData));
        
});
 
</script>
 
<script type="text/x-kendo-template" id="template">
    <h3>#= subject #</h3>
    <h4>posted on #= time # by <strong>#= sender #</strong></h4
</script>
 
 <div id="preview"></div>

1 Answer, 1 is accepted

Sort by
0
Accepted
John DeVight
Top achievements
Rank 1
answered on 10 Aug 2012, 09:58 PM

Hi Peter,

Looking at the source code for the window, the content gets loaded using jQuery.ajax.  The problem with jQuery.ajax in your case is that it will not execute any javascript.  A suggestion would be to initialize the window and then load the contents using jQuery.load.

var window = $("#window");
  
window.kendoWindow({
    width: "505px",
    height: "315px",
    title: "Mail",
    actions: ["Refresh", "Maximize", "Close"],
    iframe:false
});
  
window.load("inbox/getemail.aspx?msgid="+msgid);
  
window.data("kendoWindow").open();

Regards,

John DeVight
Tags
Window
Asked by
Peter
Top achievements
Rank 1
Answers by
John DeVight
Top achievements
Rank 1
Share this question
or