Hi,
Just updated from 2021.3.1207 to 2022.1.119 (VS2022 and .NET6) and all my checkboxes used in templates on all pages are not working any more.
This code:
<script id="toolbar" type="text/x-kendo-template">
<div id="blockSyncArea">
@(Html.Kendo().CheckBox().Name("blockSync").Enable(ViewBag.BlockSyncStatus.AllowUnblock).Checked(!ViewBag.BlockSyncStatus.BlockSync).Label("Sync Enabled").HtmlAttributes(new
{
onchange = "onBlockSyncChanged();",
title = "Toogle to enable or disabled syncing with clients while editing."
}))
</div>
}
</script>
Renders like this in 2021.3.1207 (seems to be plain HTML5) and works correctly without any problems:
<script id="toolbar" type="text/x-kendo-template">
<div id="blockSyncArea">
<input checked="checked" class="k-checkbox" id="blockSync" name="blockSync" onchange="onBlockSyncChanged();" title="Toogle to enable or disabled syncing with clients while editing." type="checkbox" value="true" /><label class="k-checkbox-label" for="blockSync">Sync Enabled</label><input name="blockSync" onchange="onBlockSyncChanged();" title="Toogle to enable or disabled syncing with clients while editing." type="hidden" value="false" />
</div>
</script>
But renders like this in 2022.1.119 and does not work and mess up my pages:
<script id="toolbar" type="text/x-kendo-template">
<div id="blockSyncArea">
<input id="blockSync" name="blockSync" onchange="onBlockSyncChanged();" title="Toogle to enable or disabled syncing with clients while editing." type="checkbox" value="true" /><input name="blockSync" onchange="onBlockSyncChanged();" title="Toogle to enable or disabled syncing with clients while editing." type="hidden" value="false" /><script>kendo.syncReady(function(){jQuery("#blockSync").kendoCheckBox({"checked":true,"label":"Sync Enabled","enabled":true});});</script>
</div>
</script>
Clearly there has been a change using a kendoCheckBox function instead.
I get these errors in Chrome:
Uncaught SyntaxError: Unexpected token '<'
Uncaught Error: Invalid template:'
<div id="blockSyncArea">
<input id="blockSync" name="blockSync" onchange="onBlockSyncChanged();" title="Toogle to enable or disabled syncing with clients while editing." type="checkbox" value="true" /><input name="blockSync" onchange="onBlockSyncChanged();" title="Toogle to enable or disabled syncing with clients while editing." type="hidden" value="false" /><script>kendo.syncReady(function(){jQuery("#blockSync").kendoCheckBox({"checked":true,"label":"Sync Enabled","enabled":true});});' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput='\n <div id="blockSyncArea">\n <input id="blockSync" name="blockSync" onchange="onBlockSyncChanged();" title="Toogle to enable or disabled syncing with clients while editing." type="checkbox" value="true" /><input name="blockSync" onchange="onBlockSyncChanged();" title="Toogle to enable or disabled syncing with clients while editing." type="hidden" value="false" /><script>kendo.syncReady(function(){jQuery("';blockSync").kendoCheckBox({"checked":true,"label":"Sync Enabled","enabled":true});});;$kendoOutput+=;}return $kendoOutput;'
at Object.compile (kendo.all.js:238:31)
at Object.i [as template] (jquery.min.js:2:88736)
at HTMLDocument.<anonymous> (Index:671:4117)
at e (jquery.min.js:2:30005)
at t (jquery.min.js:2:30307)
Please advise, what is the problem with my very simple code. I strongly suspect a bug in the rendering, since I use the checkboxes in kendo templates and in the error message there seems to be a invalid rendering of jQuery("';blockSync") at the end, that should be #blockSync?
Regards,
Mattias