我正在尝试JQWidgets
在我的ASP.net MVC
应用程序中使用,但在JqxGrid
.
这是包含grid
.
@model IEnumerable<jQWidgets.AspNet.Core.Models.Employee>
@{
ViewData["Title"] = "ASP .NET MVC Grid Example";
}
<label>ASP .NET Core MVC Grid Tag Helper Example</label><br/><br/>
<jqx-grid theme="@ViewData["Theme"]" sortable="true" filterable="true" autoheight="true" width="850" source="Model">
<jqx-grid-columns>
<jqx-grid-column columngroup="name" datafield="FirstName" width="100" text="First Name"></jqx-grid-column>
<jqx-grid-column columngroup="name" datafield="LastName" width="100" text="Last Name"></jqx-grid-column>
<jqx-grid-column datafield="Title" width="150"></jqx-grid-column>
<jqx-grid-column datafield="Address" width="200"></jqx-grid-column>
<jqx-grid-column datafield="City" width="150"></jqx-grid-column>
<jqx-grid-column datafield="Country"></jqx-grid-column>
</jqx-grid-columns>
<jqx-grid-column-groups>
<jqx-grid-column-group name="name" text="Name"></jqx-grid-column-group>
</jqx-grid-column-groups>
</jqx-grid>
这是在列表中返回 5 条员工记录的控制器。
public ActionResult Index()
{
return View(_context.Employees.ToList());
}
jqxgrid
我在页面上看到一个空白。
所有必需的 jqx 脚本都_layout.cshtml
使用Bundles
. 此外,我在另一个页面上有一个类似的网格,使用 Ajax/jquery 显示相同的信息,它工作得很好,但我想避免使用这种方式。