Refactor InfoPanel: non-generic, nested grid support
- Replace generic InfoPanel with non-generic version using IInfoPanelBase - Add ParentGrid, GetRootGrid, and InfoPanelInstance to IMgGridBase for nested grid hierarchy - Only root grid displays InfoPanel; nested grids inherit context - InfoPanel now handles any data type via reflection and object - All grid-to-InfoPanel communication routed through root grid - Add option to show/hide readonly fields in edit mode - Improve InfoPanel CSS for up to 4 responsive columns - Remove redundant code and add debug output for InfoPanel data flow
This commit is contained in:
parent
a0f7ac6a29
commit
903711ed04
|
|
@ -26,6 +26,24 @@ public class MgGridBase : DxGrid, IMgGridBase
|
|||
/// <inheritdoc />
|
||||
public MgGridEditState GridEditState { get; private set; } = MgGridEditState.None;
|
||||
|
||||
/// <inheritdoc />
|
||||
[CascadingParameter]
|
||||
public IMgGridBase? ParentGrid { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IMgGridBase GetRootGrid()
|
||||
{
|
||||
var current = (IMgGridBase)this;
|
||||
while (current.ParentGrid != null)
|
||||
{
|
||||
current = current.ParentGrid;
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IInfoPanelBase? InfoPanelInstance { get; set; }
|
||||
|
||||
[Inject] public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
|
||||
[Inject] public required FruitBankSignalRClient FruitBankSignalRClient { get; set; }
|
||||
[Inject] public required LoggedInModel LoggedInModel { get; set; }
|
||||
|
|
@ -170,6 +188,8 @@ public class MgGridBase : DxGrid, IMgGridBase
|
|||
}
|
||||
}
|
||||
|
||||
public bool ShowInfoPanel { get; set; } = false;
|
||||
|
||||
async Task Grid_LayoutAutoLoading(GridPersistentLayoutEventArgs e)
|
||||
{
|
||||
e.Layout = await LoadLayoutFromLocalStorageAsync($"{AutoSaveLayoutName}_AutoSave_{LoggedInModel.CustomerDto?.Id ?? 0}");
|
||||
|
|
|
|||
Loading…
Reference in New Issue