Add row focusing support to CatalogsGrid and MassDataGrid
Enable row focusing in both grid components by introducing the focusedRowKey property and binding it to the grid. After create or update operations, set focusedRowKey to the affected item's key, ensuring the grid automatically focuses the relevant row. Improves user experience by highlighting newly created or updated items.
This commit is contained in:
@@ -128,6 +128,8 @@ else
|
||||
CustomizeEditModel="OnCustomizeEditModel"
|
||||
EditModelSaving="OnEditModelSaving"
|
||||
DataItemDeleting="OnDataItemDeleting"
|
||||
FocusedRowEnabled="true"
|
||||
@bind-FocusedRowKey="focusedRowKey"
|
||||
@ref="gridRef">
|
||||
<Columns>
|
||||
@RenderColumns()
|
||||
@@ -171,6 +173,7 @@ else
|
||||
private EditContext? editContext;
|
||||
private ValidationMessageStore? validationMessageStore;
|
||||
private IGrid? gridRef;
|
||||
private int? focusedRowKey;
|
||||
private string popupHeaderText = "Edit";
|
||||
private const string LayoutType = "GRID_BANDS";
|
||||
private const string LayoutKey = "CatalogsGrid";
|
||||
@@ -347,6 +350,7 @@ else
|
||||
}
|
||||
|
||||
infoMessage = "Katalog angelegt.";
|
||||
focusedRowKey = created.Value.Guid;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -359,6 +363,7 @@ else
|
||||
}
|
||||
|
||||
infoMessage = "Katalog aktualisiert.";
|
||||
focusedRowKey = editModel.Guid;
|
||||
}
|
||||
|
||||
await LoadCatalogs();
|
||||
|
||||
@@ -148,6 +148,8 @@ else
|
||||
CustomizeEditModel="OnCustomizeEditModel"
|
||||
EditModelSaving="OnEditModelSaving"
|
||||
DataItemDeleting="OnDataItemDeleting"
|
||||
FocusedRowEnabled="true"
|
||||
@bind-FocusedRowKey="focusedRowKey"
|
||||
@ref="gridRef">
|
||||
<Columns>
|
||||
@RenderColumns()
|
||||
@@ -208,6 +210,7 @@ else
|
||||
private EditContext? editContext;
|
||||
private ValidationMessageStore? validationMessageStore;
|
||||
private IGrid? gridRef;
|
||||
private int? focusedRowKey;
|
||||
private const string LayoutType = "GRID_BANDS";
|
||||
private const string LayoutKey = "MassDataGrid";
|
||||
private const string LayoutUserStorageKey = "layoutUser";
|
||||
@@ -676,8 +679,9 @@ else
|
||||
|
||||
try
|
||||
{
|
||||
await Api.UpsertAsync(dto);
|
||||
var saved = await Api.UpsertAsync(dto);
|
||||
infoMessage = editModel.IsNew ? "MassData angelegt." : "MassData aktualisiert.";
|
||||
focusedRowKey = saved.Id;
|
||||
await LoadPage(pageIndex);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user