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();
|
||||
|
||||
Reference in New Issue
Block a user