Is there any way to persist the state of the tilelayout and loading it initially?

1 Answer 85 Views
TileLayout
Severin
Top achievements
Rank 1
Severin asked on 10 Dec 2021, 08:24 AM

I am trying to implement a dashboard where the user can add / remove and reorder widgets.

Loading the persisted state should not be a problem since I can create something like this:

<kendo-tilelayout-item *ngFor="let widget of widgets"
                       [title]="widget.title"
                       [col]="widget.col"
                       [order]="widget.order">...</kendo-tilelayout-item>

But how can I persist the state of the tilelayout to my models?

I tried with the reorder event but there I haven't got any information to identify my widget models.

  public onReorder(e: TileLayoutReorderEvent): void {
    // Find the model to persist changes
  }

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 15 Dec 2021, 08:09 AM

Hi Severin,

Thank you for the provided details.

It appears that the following issue doesn't allow always getting the proper information when the (reorder) event is fired:

https://github.com/telerik/kendo-angular-layout/issues/427

Thus I am afraid that it should be resolved before a consistent state persistence approach is available. I further checked with the dedicated developers whether they could provide a timeframe as to when the issue can be expected to be resolved, but it isn't yet added to our future development plans, thus I am unable to provide an estimated time of delivery at this point. 

Once the issue is resolved I can confirm that the (reorder) event should be handled as demonstrated. It emits an object of type TyleLayoutReorderEvent that provides the reordered item and its newCol, newRow, newIndex. Based on these properties the underlying object within the widgets array should be updated. Indeed there isn't a built-in state persistence approach, but the suggested way could be used. Please let me know in case I can provide any further information on this case.

Regards,
Svet
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.

Tags
TileLayout
Asked by
Severin
Top achievements
Rank 1
Answers by
Svet
Telerik team
Share this question
or