Hi,
I cannot get Click event on button inside <script type="text/x-kendo-template"> .
My code:
<script type="text/x-kendo-template" id="template-sub">
<div id="details-container-sub" class="details-container">
<table id="datails-sub-table" class="datails-table">
<tr >
<th>Parameter</th>
<th>Value</th>
</tr>
<tr>
<td align="right">Connected By:</td>
<td>#= ConnectedBy #</td>
</tr>
<tr>
<td align="right">Connected On: </td>
<td>#= ConnectedOn #</td>
</tr>
</table>
<div>
<button id="btnClose" class="k-button close-button">Close</button>
</div>
</div>
</script>
@(Html.Kendo().Window().Name("Details")
.Visible(false)
.Modal(true)
.Draggable(true)
.Width(450)
)
<script>
function showDetails(e) {
e.preventDefault();
var wnd = $("#Details").data("kendoWindow");
var treeItem = $("#ddlSubs").data("kendoTreeList").dataItem($(e.currentTarget).closest("tr"));
switch (treeItem.Type) {
case "sub":
wnd.title("Subscription Details");
wnd.content(kendo.template($("#template-sub").html())(treeItem));
wnd.center().open();
break;
[.... more cases...]
}
}
$(document).ready(function () {
$('#Details').data("kendoWindow").bind('refresh', function (e) {
var wnd = $("#Details").data("kendoWindow");
$('#btnClose').click(function () {
wnd.close();
});
});
});
</script>
What is wrong?
Thank you in advance.