This is a migrated thread and some comments may be shown as answers.

Reorder problem in kendoTilesLayout

1 Answer 213 Views
TileLayout
This is a migrated thread and some comments may be shown as answers.
Christophe
Top achievements
Rank 1
Christophe asked on 08 Mar 2021, 04:49 PM

I have an issue and I need someone to see what I'm doing wrong...

I tried to use several times "reorder". I simplify the test to this :

<!-- container templates -->
  <script id="barcelona" type="text/x-kendo-template">
            A
  </script>
 
<script id="sofia" type="text/x-kendo-template">
            B
</script>
 
 
$("#home-super-container").kendoTileLayout({
                containers: [{
                    colSpan: 1,
                    rowSpan: 1,
                    header: {
                        text: "Barcelona"
                    },
                    bodyTemplate: kendo.template($("#barcelona").html())
                }, {
                    colSpan: 1,
                    rowSpan: 1,
                    header: {
                        text: "Sofia"
                    },
                    bodyTemplate: kendo.template($("#sofia").html())
                }],
                columns: 2,
                columnsWidth: 285,
                rowsHeight: 285,
                reorderable: true,
                reorder: function (e) {
                            console.log(e.newIndex, e.oldIndex);
                }
    });

 

The console.log indicates (0 0), it should be (0 1) or (1 0)...

 

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 09 Mar 2021, 02:43 PM

Hi Christophe,

Thank you for the code snippet.

The indexes (the new and the previous one) of a certain tile remain the same when it is dragged from its position, but it is not dropped on another one. For example, a tile's index is 0 and it is attempted to be moved on position 2 (index = 1), instead, it is moved back to its initial position (index = 0). In this case, the tile's old index is 0 and the new index is again 0 since its position is not changed.

Also, this happens when the places of the two tiles, are not swapped visually, before the dropping of the tile on its new position. The required steps to reorder the tiles are:

  1. Drag the tile to the desired position;
  2. The tile is visually outlined over its new position;
  3. Drop the tile over the desired position.

Let me know if you have any other queries and I would be happy to assist you.

 

Regards, Mihaela Lukanova 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
Christophe
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or