117 lines
4.0 KiB
Plaintext
117 lines
4.0 KiB
Plaintext
@model Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Models.TestGridModel
|
|
@using System.Text.Json
|
|
|
|
<div class="card">
|
|
<div class="card-header bg-info text-white">
|
|
<h4>Test Child Grid View Component</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<h5>Grid Information:</h5>
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<td><strong>Grid ID:</strong></td>
|
|
<td>@Model.Id</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Grid Name:</strong></td>
|
|
<td>@Model.GridName</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>View Component Name:</strong></td>
|
|
<td>@Model.ViewComponentName</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Level:</strong></td>
|
|
<td>@Model.Level</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Parent Grid ID:</strong></td>
|
|
<td>@(Model.ParentGridId?.ToString() ?? "None")</td>
|
|
</tr>
|
|
</table>
|
|
|
|
@if (Model.DataContext != null && Model.DataContext.Any())
|
|
{
|
|
<h5 class="mt-3">Data Context:</h5>
|
|
<table class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Key</th>
|
|
<th>Value</th>
|
|
<th>Type</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var kvp in Model.DataContext)
|
|
{
|
|
<tr>
|
|
<td><strong>@kvp.Key</strong></td>
|
|
<td>@kvp.Value</td>
|
|
<td><em>@kvp.Value.GetType().Name</em></td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
|
|
@if (Model.DataContext.ContainsKey("contextId"))
|
|
{
|
|
<div class="alert alert-success mt-3">
|
|
<strong>Context ID Found:</strong> @Model.DataContext["contextId"]
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="alert alert-warning mt-3">
|
|
<strong>Warning:</strong> No contextId found in DataContext
|
|
</div>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<div class="alert alert-warning mt-3">
|
|
<strong>No Data Context available</strong>
|
|
</div>
|
|
}
|
|
|
|
@if (Model.Configuration != null)
|
|
{
|
|
<h5 class="mt-3">Configuration:</h5>
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<td><strong>Show Child Grids As Tabs:</strong></td>
|
|
<td>@Model.Configuration.ShowChildGridsAsTabs</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Requires Parent Row Selection:</strong></td>
|
|
<td>@Model.Configuration.RequiresParentRowSelection</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Description:</strong></td>
|
|
<td>@(Model.Configuration.Description ?? "N/A")</td>
|
|
</tr>
|
|
</table>
|
|
}
|
|
|
|
@if (Model.ChildGrids != null && Model.ChildGrids.Any())
|
|
{
|
|
<div class="alert alert-info mt-3">
|
|
<strong>Child Grids:</strong> This grid has @Model.ChildGrids.Count child grid(s)
|
|
<ul class="mb-0 mt-2">
|
|
@foreach (var child in Model.ChildGrids)
|
|
{
|
|
<li>@child.GridName (Level @child.Level)</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="alert alert-secondary mt-3">
|
|
<strong>No child grids</strong>
|
|
</div>
|
|
}
|
|
|
|
<h5 class="mt-3">Full Model JSON:</h5>
|
|
<pre class="bg-light p-3" style="max-height: 300px; overflow-y: auto;">@JsonSerializer.Serialize(Model, new JsonSerializerOptions { WriteIndented = true })</pre>
|
|
</div>
|
|
</div> |