The TileLayout should not render tabindex="0" on its tiles when Navigable="false".
Here is a test page with a workaround:
@inject IJSRuntime js
<p>Tab through the textboxes:</p>
<input />
<TelerikTileLayout Columns="2"
RowHeight="200px"
Resizable="false"
Reorderable="false"
Navigable="false"
Class="tilelayout-tabindex-remove">
<TileLayoutItems>
<TileLayoutItem HeaderText="Tile 1">
<Content>
<p>TileLayout Navigable="false" - will focus the inner textbox and will not focus the tiles.</p>
<input />
</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Tile 2">
<Content>Tile 2 content.</Content>
</TileLayoutItem>
</TileLayoutItems>
</TelerikTileLayout>
<input />
<TelerikTileLayout Columns="2"
RowHeight="200px"
Resizable="false"
Reorderable="false"
Navigable="true">
<TileLayoutItems>
<TileLayoutItem HeaderText="Tile 1">
<Content>
<p>TileLayout Navigable="true" - will not focus the inner textbox and will focus the tiles. Focus the textbox with Enter when on the tile.</p>
<input />
</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Tile 2">
<Content>Tile 2 content.</Content>
</TileLayoutItem>
</TileLayoutItems>
</TelerikTileLayout>
<input />
<script suppress-error="BL9992">
function removeTabindexFromTiles(selector) {
var tileLayout = document.querySelector(selector);
if (!tileLayout) {
return;
}
tileLayout.querySelectorAll(".k-tilelayout-item").forEach(el => {
el.removeAttribute("tabIndex");
});
}
</script>
@code {
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await Task.Delay(1); // ensure HTML is ready
await js.InvokeVoidAsync("removeTabindexFromTiles", ".tilelayout-tabindex-remove");
}
await base.OnAfterRenderAsync(firstRender);
}
}
We have a tile layout control within a tab page used on the whole page, we have resizing and moving enabled by dragging. Works well on desktop however on ios safari users are unable to scroll on the page, instead the page either does not move or tiles resize/move. If we disable only resizable or reorderable, the page is still not scrollable.
===
ADMIN EDIT
===
The only option for the time being is to disable resizing and reordering on mobile devices.
While your existing TileLayout seems to be striving for this it doesn't seem to function as intuitively, or perhaps it is supposed to but has bugs? Ideally I'd like to have a layout component that mimics what I see in the Azure portal, however I realize from other feedback tickets you're not going to do that. The ability to have gaps really makes the user experience better. I understand things have to be 'touching' (eg I can't just place something off into the bottom right corner of the screen by itself) but being able to do something like you see in the attached gridstack_basic_demo_img1.jpg would be great.
It seems easy to get into an odd state using the TileLayout, even creating gaps where I don't want them and I'm unable to fix it. For example in telerik_tilelayout_img1.jpg you see your demo page, I have the "Bounce Rate" box with a gap above it and for whatever reason I can't even bring it UP to fill the gap (dragging it up the red arrow path and dropping it gets rejected and the box floats back to where it is in the img).
I really want to use your TileLayout but I think using it as-is would really frustrate my userbase. Do you have plans to improve it's functionality and overall user experience?
Thanks for your consideration
### Description
Add the option to constrain the RowSpan and ColSpan of individual tiles in the TileLayout.
### Specification (if feature)
Add options to the tiles such as MinColSpan, MaxColSpan, MinRowSpan, and MaxRowSpan.
Currently, only `RowSpan` `ColSpan` and `HeaderText` parameters cause a `TileLayout` to rerender when changed. I use `Class` changes for a lot of styling (in particular it's useful for hiding/showing a `TileLayoutItem` without losing its position in the layout) and have to manually detect and call `StateHasChanged()` when the `Class` parameter changes on `TileLayoutItem`.
Please allow dynamic change of the TileLayoutItem Class property.
I want to prevent an individual TileLayoutItem from being resized or reordered when Reorderable and Resizable are enabled on component level.
===
ADMIN EDIT:
Here is a possible workaround - prevent pointer events for the tile that should not be resized and reordered. Note that users may still be able to push the "disabled" tile to a new place by reordering the other tiles.
<TelerikTileLayout Columns="3"
RowHeight="150px"
Resizable="true"
Reorderable="true">
<TileLayoutItems>
<TileLayoutItem HeaderText="Tile 1">
<Content>Regular-sized first tile.</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Tile 2">
<Content>You can put components in the tiles too.</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Tile 3" RowSpan="3" Class="disabled-tile">
<Content>No resizing and no reordering</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Tile 4" RowSpan="2" ColSpan="2">
<Content>This tile is two rows tall and two columns wide</Content>
</TileLayoutItem>
</TileLayoutItems>
</TelerikTileLayout>
<style>
.disabled-tile {
pointer-events: none;
}
</style>
Hi,
We would like to request a feature wherein we can drag the tile on empty spaces and triggers the reordering of tiles. To make it some kind of docking feature on the TileLayout.
So far the workaround we see to put the tiles on those empty spaces is when you drag the tile in between tiles (between conversion rate and page views tiles) and if you drag it again on the same row it will reorder fine. Another one is to drag the tile on another tile (drag into most viewed pages tile) it will reorder the dragged tile on that empty space beside the existing tile.
https://demos.telerik.com/blazor-ui/tilelayout/overview
Here's a sample of what we did:
Hi,
Is there a way we could drag the tile on those empty spaces in the tile layout? I've tried the samples in your page and it seems reorderable only reorders the tiles. Is it possible to put an option that we might be able to drag those tiles to the empty spaces instead of dragging them to another tile to switch places? See attached file as reference on what I meant.
In TelerikTileLayout the TileLayoutItem have the possibility to have have a HeaderText or even a HeaderTemplate, and behave as a TelerikCard, only without a footer.
Having the possibility to have a FooterTemplate would grant a better managment of the layout.
I am using a couple buttons in the HeaderTemplate of the tiles. It looks like their click events are sometimes not honored due to a mix up with the draggable event of the tiles when they are reorderable. Please prevent the component from stopping the click event in the tile header.
---
ADMIN EDIT
---
As a workaround for the time being, you can stop the propagation of the container wrapping the clickable elements:
<!-- suppress-error allows the script tag to be in a Razor file -->
<script suppress-error="BL9992">
window.stopPropagation = (e) => {
e.stopPropagation();
}
</script>
<TelerikTileLayout Columns="3"
RowHeight="150px"
Resizable="true"
Reorderable="true">
<TileLayoutItems>
@{
foreach (var tile in Tiles)
{
<TileLayoutItem @key="@tile">
<HeaderTemplate>
<div class="d-flex flex-col w-100 justify-content-between">
<div class="d-flex flex-row w-75">
<div class="p-2"><strong>@tile.Title</strong></div>
</div>
<div onpointerdown="stopPropagation(event)"
class="d-flex flex-row w-25 justify-content-end">
<TelerikButton Icon="edit" Title="Edit Tile" Class="k-flat"
OnClick="@(()=>EditTile(tile))">
</TelerikButton>
<TelerikButton Icon="close" Title="Delete Tile" Class="k-flat"
OnClick="@(()=>DeleteTile(tile))">
</TelerikButton>
</div>
</div>
</HeaderTemplate>
<Content>@tile.Content</Content>
</TileLayoutItem>
}
}
</TileLayoutItems>
</TelerikTileLayout>
Event log: <TelerikButton Icon="clear" OnClick="@ClearLog">Clear Log</TelerikButton>
@if (EventLog != null)
{
<ul>
@foreach (string log in EventLog)
{
<li>
@log
</li>
}
</ul>
}
@code {
private List<TileData> Tiles { get; set; }
List<string> EventLog { get; set; } = new List<string>();
async void EditTile(TileData tile)
{
EventLog.Add("Edit fired for " + tile.Title);
}
async void DeleteTile(TileData tile)
{
EventLog.Add("Delete fired for " + tile.Title);
}
void ClearLog()
{
EventLog = new List<string>();
}
protected override void OnInitialized()
{
Tiles = new List<TileData>()
{
new TileData { Title = "Tile 1", Content = "1 - Lorem Ipsum" },
new TileData { Title = "Tile 2", Content = "2 - Lorem Ipsum" },
new TileData { Title = "Tile 3", Content = "3 - Lorem Ipsum" },
new TileData { Title = "Tile 4", Content = "4 - Lorem Ipsum" },
new TileData { Title = "Tile 5", Content = "5 - Lorem Ipsum" },
new TileData { Title = "Tile 6", Content = "6 - Lorem Ipsum" },
};
base.OnInitialized();
}
public partial class TileData
{
public string Title { get; set; }
public string Content { get; set; }
}
}
I am trying to resize a TextBox inside of a TileLayoutItem on resize of the tile. I have the resize handler implemented, and is accurately firing. However, I am not seeing the ColSpan actually change on the item, which would give me a point of reference to resize the textbox.
void OnResizeHandler(TileLayoutResizeEventArgs args) { if (args.Id == "commentTile") { if (CommentLI.ColSpan==1) { CommentWidth = "270px"; } else { CommentWidth = (270 + (300 * (CommentLI.ColSpan - 1))).ToString() + "px"; } } }
Hey all, I just tried the big upgrade (VS 2020, .Net 6). During it, I moved from Telerik UI for Blazor 2.30. I've invested a lot of time into using this component and it came out as a non-starter in this release. After digging for a couple hours, I just kept it simple (see code).
Any time you put an @ inside a TileLayoutItem, it breaks - just freezes everything. So I can't tell you where it is coming from, but I can tell you it doesn't work. To reproduce, see the following code, but basically use "@someObject" as the value of an attribute of TileLayoutItem or inside Content/HeaderTemplate.
My use case is more complicated and I'm waiting for a mid-December pre-release (see ticket 1543513), but here's a way to reproduce (I hope)
Example:
<TelerikTileLayout Reorderable="true"
Resizable="true"
>
<TileLayoutItems>
@foreach (string name in Names)
{
<TileLayoutItem Class="builder">
<Content>@name</Content>
</TileLayoutItem>
}
</TileLayoutItems>
</TelerikTileLayout>
@code {
public List<string> Names { get; set; } = new List<string> { "Sara", "Dan", "Frank", "Deuce" };
}
Here is the scenario I would like to implement:
User has a default dashboard, with Customise functionality which would:
For loading and saving the dashboard with each tile having a specific content the easiest way I can see would be to bind the TelerikTileLayout to a data source:
<TelerikTileLayout Data="@TileData">
<TileConfiguration></TileConfiguration>
</TelerikTileLayout>
The data would be updated as and when the user configures their dashboard.
For dragging and dropping new tiles a set of events would be necessary, both on the source tile list, e.g. OnDragBegin and on the tile layout OnDrop.
I want to dynamically change the TileLayout Reorderable parameter but the component does not react to that change. Dynamic change in the Resizable parameter is also not applied.
I am also trying to change the TileLayoutItem ColSpan dynamically - for example, when implementing it in a responsive layout (https://docs.telerik.com/blazor-ui/knowledge-base/tilelayout-responsive) but using a variable as the ColSpan value does nothing. The TileLayout does not react to a change in the ColSpan parameter either.
It would be nice if the TelerikTileLayout could be told to refresh itself or to refresh after some of its parameters is changed.