我尝试运行下面从FineUI示例下载的代码,但网格未刷新。 同样,在razer页面的UI上labResult文本也没有更新。在线托管的示例中似乎也使用了相同的代码。可能是什么问题?
public IActionResult OnPostGrid1_PageIndexChanged(string[] Grid1_fields, int Grid1_pageIndex)
{
var grid1 = UIHelper.Grid("Grid1");
var recordCount = DataSourceUtil.GetTotalCount();
// 1. Set the total number of records (if the total number of records does not change, you can not set RecordCount)
grid1.RecordCount(recordCount);
grid1.Title("Fake title here");
// 2. Get the current paged data
var dataSource = DataSourceUtil.GetPagedDataTable(pageIndex: Grid1_pageIndex, pageSize: 5);
grid1.DataSource(dataSource, Grid1_fields);
var labResult = UIHelper.Label("labResult");
labResult.Text(String.Format("User input value: {0}", "NOTHING MATTERS"));
return UIHelper.Result();
}
下面是相关的.cshtml
<f:Grid ID="Grid1" IsFluid="true" Title="Product List" ShowHeader="false" ShowBorder="true" CssClass="blockpanel"
DataIDField="Id" DataTextField="Name" EnableCheckBoxSelect="true"
AllowPaging="true" PageSize="5" IsDatabasePaging="true"
RecordCount="@ViewBag.Grid1RecordCount" DataSource="@ViewBag.Grid1DataSource"
ShowPagingMessage="false" EnableColumnLines="true"
OnPageIndexChanged="@Url.Handler("Products_PageIndexChanged")"
OnPageIndexChangedFields="Grid1">
<Columns>
<f:RenderField ColumnID="Desc" RenderAsRowExpander="true"></f:RenderField>
<f:RenderField HeaderText="Code" DataField="Code" MinWidth="80" />
<f:RenderField HeaderText="Name" DataField="ShortName" MinWidth="200" />
<f:RenderField HeaderText="Long Desc" DataField="ExtendedDesc" MinWidth="250" />
<f:RenderField HeaderText="Vat Code" DataField="VatCode" MinWidth="80" />
<f:RenderField HeaderText="Category" DataField="Category" RendererFunction="renderCategory" MinWidth="100" />
<f:RenderField HeaderText="Manufacturer" DataField="Manufacturer" RendererFunction="renderCategory" MinWidth="120" />
<f:RenderField HeaderText="Actions" EnableHeaderMenu="false" RendererFunction="renderActionField" />
</Columns>
</f:Grid>