Components render outside of wizard container

1 Answer 86 Views
Wizard
candice
Top achievements
Rank 1
candice asked on 11 Jan 2023, 06:50 AM

Hi

 

I have a wizard that loads partials as steps. Whenever I add more than one kendo component (for example a gauge and a slider) onto the same partial the second component renders outside of the wizards' container.

 

Please assist with this.

 

Kind Regards

1 Answer, 1 is accepted

Sort by
1
Accepted
Alexander
Telerik team
answered on 13 Jan 2023, 03:56 PM

Hi Candice,

I noticed that this is a duplicate question of a similar support thread that you have recently opened. Nevertheless, for the benefit of the community, I am also attaching my reply here:

Upon further examination, I noticed that the sporadic behavior would most notably stem from the fact that the script of the Gauge and Slider controls is rendered immediately after the HTML markup, where the components are nested in the Wizard and loaded through a template. 

Thus, I would suggest calling the "Deferred()" method of both the Slider and Gauge Helpers and rendering the deferred initialization script after the template:
@(Html.Kendo().RadialGauge()
    .Name("gauge")
    ...
    .Deferred()
) 
@(Html.Kendo().Slider()
    ...
    .Deferred()
)

And calling the @Html.Kendo().DeferredScripts() method:

<script id="familyInformation" type="text/kendo-template">
    @await Html.PartialAsync("_FamilyInformation")
</script>
<script id="expectedClaims" type="text/kendo-template">
    @await Html.PartialAsync("_ExpectedClaims")
</script>

@Html.Kendo().DeferredScripts();

For more information about deferred initialization, refer to the following article:

Kind Regards,
Alexander
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Wizard
Asked by
candice
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or