I am trying to display a popup window with values from a kendo template
and kendowindow
. Though no errors, the following code is not showing the pop up window and the template content. Any idea what need to be changed to display this?
UPDATE
The popup came when I removed the msie browser check. But still it is not displaying the template content. Am I missing anything?
I referred following stack overflow posts and many other blogs to fix this.
- Filtering source in a Kendo Template
- select and show in new window Kendoui grid row data?
- Creating a div element in jQuery
- browser.msie error after update to jQuery 1.9.1
CODE
<head>
<title>Kendo Template and Kendo Window</title>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://cdn.kendostatic.com/2013.2.716/js/kendo.all.min.js"></script>
<!---- lijo Kendo Templates-->
<script id="row-template" type="text/x-kendo-template">
<tr>
<td data-bind="text: name"></td>
<td data-bind="text: age"></td>
</tr>
</script>
<script type="text/javascript">
//lijo
$(document).ready(function () {
var viewModel = kendo.observable({
employees: [
{ name: "Lijo", age: "28", IsSelected: true },
{ name: "Binu", age: "33", IsSelected: false },
{ name: "Kiran", age: "29", IsSelected: true }
]
});
kendo.bind($("body"), viewModel);
});
//lijo
function showMakeAndHold() {
alert("HIIIIIII");
var drilldownpopup = $('<div class="myClass">A</div>');
if (!drilldownpopup.data('kendoWindow'))
{
drilldownpopup.kendoWindow({
modal: true
});
}
drilldownpopup.data('kendoWindow').title(" ");
$('.k-window-actions').html('<span class="titletext">' + "MAKE HOLD BALANCE ITEM" + '</span><a href="#" class="k-window-action k-link"><span class="k-icon k-i-close"></span></a>');
var myString =
['<html><body><table id="resultTable">',
'<tbody data-template="row-template" data-bind="source: employees">',
'</tbody>',
'</table>AAAA</body></html>'
].join('\n');
drilldownpopup.data('kendoWindow').content(myString);
drilldownpopup.data('kendoWindow').open();
drilldownpopup.data('kendoWindow').center();
}
</script>
</head>
<body>
A B
<button id = "MakeHoldDetailLinkButton" class="MakeHoldDetailLinkButton" onclick = "showMakeAndHold();">View Make Hold</button>
<div class="drilldownwindow">SS</div>
</body>