Completed
Last Updated: 10 Nov 2020 15:25 by ADMIN
Release 2020.R3.SP.next
Jon
Created on: 05 Sep 2019 17:58
Category: Dialog
Type: Bug Report
0
HtmlAttributes method is not assigning the class

I have a dialog defined but the "mydialog-control" CSS class never gets added to the dialog when it's rendered.  Why is that happening?

@(Html.Kendo().Dialog()
    .Name("SalesTypeWarning")
    .Title("Warning")
    .Content(warningTextContent)
    .Modal(true)
    .Closable(false)
    .Visible(false)
    .Width(600)
    .HtmlAttributes(new { @class = "mydialog-control"})
    .Actions(act =>
    {
      act.Add().Text("Continue").Primary(true).Action("allowSalesTypeChange");
      act.Add().Text("Cancel Change").Action("cancelClicked");
    })
    .Deferred(true)
)
1 comment
ADMIN
Aleksandar
Posted on: 09 Sep 2019 15:14

Hi Jon,

Thank you for reporting this behavior. I have investigated further and it appears that this is a bug. Thus, I have converted this item to a bug in the Public Feedback Portal and also logged it on GitHub:

As a temporary workaround you can use the Window widget where this functionality is supported. The below example would initialize a window widget with the myTestClass attribute added t the widget's instance:

 

@(Html.Kendo().Window()
    .Name("myDialog")
    .Title("My Dialog")
    .Content(@<text>
            <div>Window content here</div>
            <hr />
            @Html.Kendo().Button().Name("SubmitBtn").Content("Continue")
            @Html.Kendo().Button().Name("CancelBtn").Content("Cancel")
    </text>
)
.Modal(true)
.Visible(true)
.Width(600)
.HtmlAttributes(new { @class = "myTestClass" })
)

Also, as a small token of gratitude for helping us discover this issue, I have updated your Telerik Points accordingly.

Regards,
Aleksandar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.