Header in LayoutGrid: Mixing of Text() and TemplateId() leads to strange behaviour

1 Answer 116 Views
TileLayout
Christine
Top achievements
Rank 2
Iron
Christine asked on 03 Jun 2021, 02:49 PM

Hello

when mixing Text() and TemplateId() for the headers in a LayoutGrid, it is working fine until Text() is used the first time. After that the header uses the content of the previous header.

The complete example (just copy / paste it):

<div class="demo-section list-wrapper">
    <h3 class="title">
        Reorder Items
    </h3>
    <script id="ll" type="text/x-kendo-template">
        <ul>
            <li class="list-left">Item 1</li>
            <li class="list-left">Item 2</li>
            <li class="list-left">Item 3</li>
        </ul>
    </script>

    <script id="lr" type="text/x-kendo-template">
        <ul>
            <li class="list-right">Item a</li>
            <li class="list-right">Item b</li>
            <li class="list-right">Item c</li>
        </ul>
    </script>

    <script id="header-template" type="text/x-kendo-template">
        <strong>List 2</strong>
    </script>

    <script id="header-template-1" type="text/x-kendo-template">
        <strong>Liste 1</strong>
    </script>
</div>


@(Html.Kendo().TileLayout()
    .Name("tilelayout")
    .Columns(4)
    .Containers(c => {
        c.Add().Header(h => h.TemplateId("header-template-1")).BodyTemplateId("ll");
        c.Add().Header(h => h.TemplateId("header-template")).BodyTemplateId("lr");
        c.Add().Header(h => h.Text("Header for List")).BodyTemplateId("ll");
        c.Add().Header(h => h.TemplateId("header-template")).BodyTemplateId("lr");
    })
    .Resizable()
    .Reorderable()
)

 

I would expect for the headers:

- Liste 1

- List 2

- Header for List

- List 2

 

I get this:

The last one is wrong.

Of course, I can use TemplateId() for all of them.

If it is by design, add a note to the documentation, please.

Best regards

Christine

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 08 Jun 2021, 08:08 AM

Hi Christine,

Thank you for pointing out that behavior. It is not expected and is a Bug. I have therefore logged an issue on it on your behalf:

https://github.com/telerik/kendo-ui-core/issues/6450 

Currently I can't provide a workaround for the issue, so I can suggest monitoring the above issue for further details.

As a token of appreciation or helping us improve our product I have updated your Telerik points.

Regards,
Aleksandar
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
TileLayout
Asked by
Christine
Top achievements
Rank 2
Iron
Answers by
Aleksandar
Telerik team
Share this question
or