Hello @Philip,
What is PBIEmbeds and CurrentState?
I would love to get my Charts to refresh when moving them around
BR,
Nikolas
Hello Philip,
That would be a valid way to know which index was resized.
Resizing a tile does not reorder tiles, and reordering tiles does not resize them. It may appear that it does because changing sizes and/or positions can alter the entire layout because the tiles will adjust to fill in gaps immediately, but one setting does not affect the other directly.
As for the video - I am not sure what I should be seeing, but I suspect there is code in the tiles that consumes some of the mouse events which might be causing things.
Regards,
Marin Bratanov
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/.
Is this the best way for now?
(compare a stored "pre-resize" state with the new? - and attach to both OnResize and OnReorder because OnReorder may resize a tile - but the event will not fire in that situation)
private async Task OnTileLayoutChange(bool reloadAll = false)
{
//get previous/stored state vs newly sized - and compare
TileLayoutState newState = TileLayoutInstance.GetState();
for (int i = 0; i < newState.ItemStates.Count; i++)
{
if(newState.ItemStates.ElementAt(i).ColSpan != CurrentState.ItemStates.ElementAt(i).ColSpan
|| newState.ItemStates.ElementAt(i).RowSpan != CurrentState.ItemStates.ElementAt(i).RowSpan || reloadAll == true)
{
await PBIEmbeds.ElementAt(i).ReloadReportAsync();
}
}
CurrentState = newState;
}
@Marin: seems to work ok (attached), but some behaviour that you'll see in the video; like the event doesnt trigger and sometimes the drag event doesnt let go (but maybe that is some interfering css?).
To add some more information from a separate thread - a Tag parameter on the tile could find its way in the state and that would help with dynamic layouts where you need to also know which tile in your conditional markup the state is about, and you can build state objects with a more content-aware approach.
Regards,
Marin Bratanov
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/.