Am I crazy, or did a BUNCH of stuff stop rendering the HTML inside of passed strings?

1 Answer 42 Views
Grid Switch Template
Josh
Top achievements
Rank 1
Iron
Josh asked on 21 Nov 2024, 09:11 PM

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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivaylo
Telerik team
answered on 22 Nov 2024, 02:57 PM

Hello Josh,

Thank you for the details provided.

These methods require plain text parameters and do not accept HTML content. Here is an example of this logic:

@(Html.Kendo().Switch()
    .Name("switch")
    .Messages(c => c.Checked("YES").Unchecked("NO"))
)

Here I will provide additional resources regarding these methods:

Furthermore, I prepared a sample application where I am implementing a "Switch" and a "Grid" with custom texts.

I hope this information was helpful.

Greetings,
Ivaylo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Josh
Top achievements
Rank 1
Iron
commented on 22 Nov 2024, 03:16 PM

Thanks for your response, which confirms what I'm observing as a degraded feature.  I understand how to use custom text, but that's not sufficient because up until very recently it did accept and properly render markup.

 

I care much less about the switch's feature reduction, but far more about the grid's edit command button, because while I can workaround most items in the command area with custom commands, I'm not sure how to achieve the desired effect for the UpdateText and CancelText versions. Note: I do know how to put my own text in those items, but up until my last update, I was able to use custom 3rd party iconography, etc. in there as well with no issue.

Is there something like an UpdateTemplate instead that could be leveraged? I'm obviously not seeing that available, but that would be a quite nice feature to have to allow using more than plain text to customize those.

Josh
Top achievements
Rank 1
Iron
commented on 22 Nov 2024, 03:37 PM

So what I think I'm going to do, which gets me pretty close, is to leverage the CancelIconClass and UpdateIconClass functionality, which does still allow me to use 3rd party icon sets through class-based application. This isn't ideal, but should suffice to recover a similar UI to what I had prior to updating. 

Thanks!

Mihaela
Telerik team
commented on 27 Nov 2024, 01:22 PM

Hi Josh,

Indeed, you can adjust the "Save" and "Cancel" commands by using the following options:

  • UpdateText() and CancelText() - Set the texts of the "Save" and "Cancel" commands.
  • UpdateIconClass() and CancelIconClass() - Set the icon class of the "Save" and "Cancel" commands.

Here is a REPL sample for your reference: https://netcorerepl.telerik.com/cIvvchvG56A5Hxkm44

Also, your suggestion to implement an option that allows adding a template for the "Save"/"Cancel" commands is great. I have logged it as a feature request on your behalf in our Public Feedback Portal. You can follow the progress here and receive status updates:

Feel free to cast your vote as the more popularity the item gathers, the higher the chance of it being implemented.

Also, as a token of appreciation, I have updated your Telerik account points for the suggested feature request.

If any other questions arise, please let me know.

Regards,
Mihaela
Tags
Grid Switch Template
Asked by
Josh
Top achievements
Rank 1
Iron
Answers by
Ivaylo
Telerik team
Share this question
or