I'm just starting to catalog the issues list, but I'm immediately noticing that any markup passed to non-template areas has ceased rendering.
For example:
<div class="demo-section">
@(Html.Kendo().Switch()
.Name("switch")
.Messages(c => c.Checked("<span>YES</span>").Unchecked("<span>NO</span>"))
)
</div>
used to render the markup vs displaying the markup text. Now it spits it out.
I have used similar techniques in Grid commands as well, which are all also broken. Basic custom commands I can work around by using the .Template option instead of .Text, but for an Edit's UpdateText and CancelText, I cannot find a workaround that isn't completely unbearable to manage at anything remotely near scale.
Is there a workaround or option to re-enable rendering HTML in these places I am simply not seeing?
Also, this feels like a pretty significant change to bury inside of a generic "rendering mismatch" (which may not even be referring to this, but I cannot find anything in the breaking changes mentioning something like this change). If there's not an effective way to get back to this functionality, it's going to potentially cost me days/weeks to find a tenable solution.
How comes this is displaying a checkbox? This is an ASP.NET CORE app. I do have the mobile CSS included (not sure if that is required)
Here is the column and template. It simply renders as a checkbox.
columns.Bound("").ClientTemplateId("switchTemplate");
<script id="switchTemplate" type="text/x-kendo-template">
<text>
@(Html.Kendo().Switch()
.Name("switch#=Id#")
.Checked(true)
.ToClientTemplate()
)
</text>
</script>
Hi, I'm new to Telerik ASP.NET Core, so maybe this is a simple task. I'm using Razor Pages and would like to hide the label from one field, how can this be done? From the switch field.
Thanks,
Humberto
@(Html.Kendo().Form<ProfileModel>()
.Name("formExample")
.FormData(Model?.Input)
.HtmlAttributes(new { method = "POST" })
.Layout("grid")
.Grid(g => g.Cols(1).Gutter(0))
.Items(items => {
items.AddGroup()
.Label("Security")
.Layout("grid")
.Grid(g => g.Cols(2))
.Items(i =>
{
i.Add()
.Field(f=> f.TFA)
.Editor(e => e.Switch());
});
})
.Validatable(v =>
{
v.ValidateOnBlur(false);
v.ValidationSummary(false);
v.ErrorTemplate("<span style='color: red'>#:message#</span>");
})
)
I'm having trouble accessing switches in a grid column. I want to loop through them and toggle them on after clicking a toolbar button.
The click event is working. But getting 'undefined' on 'switchInstance ':
Column with switches code:
.Columns(columns =>
{
columns.Bound(p => p.Exempt).Width(100).Filterable(ftb => ftb.Multi(true)).Sortable(false).ClientTemplate(
"<input class='exemptSwitch' id='exemptSwitch' \\#if (Exempt) { \\# checked='checked' \\# } \\# type='checkbox' />");
})
Toolbar button code:
.ToolBar(toolBar =>
{
toolBar.Custom()
.Name("EnableAllFiltered")
.Text("Enable All Filtered")
.IconClass("k-icon k-i-play")
;
})
Click event code:
$(function () {
$(".k-grid-ExemptAllFiltered", "#SubscriberGrid").on("click", function (e) { <--- click of custom grid header toolbar button
$("#SubscriberGrid .exemptSwitch").each(function () {
var switchInstance = $(this).data("kendoSwitch");
switchInstance.enable(true);
});
});
Any assistance would be greatly appreciated!
Jon
How can I set the checked/unchecked messages for my entire application or at least for the page?
Currently, I use something like:
<
kendo-switch
for
=
"BoundProperty"
checked
=
"Model.BoundProperty"
><
messages
checked
=
"@Html.T("
Common.YES")"
unchecked
=
"@Html.T("
Common.NO")" /></
kendo-switch
>
It would be great if I didn't have to include the <messages /> tag each time.
Hello,
I try to change the background color regarding ON or OFF without success (note that .k-switch and .k-switch-handle works perfectly) :
<
style
>
.k-switch {
font-size: 12px !important;
}
.k-switch-on {
background-color: green !important;
}
.k-switch-off {
background-color: red !important;
}
.k-switch-handle{
background-color: chocolate !important;
}
</
style
>
Thank you for your precious help.
The same switch control in windos10 system,it can be slide drag:
press the block and drag,if it is samll distance,release the mouse,the block will go back,otherwise the distance exceed 30%-50%