我想在每一行中添加编辑链接,JQGrid
并希望在单击该链接时调用控制器的操作。以下是 VIEW - .cshtml 级别的详细实现:
<div>
@(Html.Trirand().JQGrid(Model.TestGrid, "TestGrid")
)
@(Html.Trirand().JQAutoComplete(
new JQAutoComplete
{
DisplayMode = AutoCompleteDisplayMode.ControlEditor,
DataUrl = Url.Action("AutoCompleteShipName","TestGrid")
}, "AutoComplete")
)
</div>
以下是JQGrid
模型级别的详细实现。
public TestModel()
{
TestGrid = new JQGrid
{
Columns = new List<JQGridColumn>()
{
new JQGridColumn { DataField = "ContractNumber",
PrimaryKey = false,
Editable = false,
Width =250 },
new JQGridColumn { DataField = "Version",
PrimaryKey = false,
Editable = false,
Width =250 },
new JQGridColumn { DataField = "StartDate",
Editable = true,
Width = 250 },
new JQGridColumn { DataField = "EndDate",
Editable = true,
Width = 350 },
new JQGridColumn { DataField = "Comments",
Editable = true,
Width = 350 },
new JQGridColumn { DataField = "Mfg",
Editable = true,
Width = 350 },
new JQGridColumn { DataField = "MfgPart",
Editable = true,
Width = 250} ,
new JQGridColumn { DataField = "Vendor",
Editable = true,
Width = 250} ,
new JQGridColumn { DataField = "CustomerNumber",
Editable = true,
Width = 250} ,
},
Width = Unit.Pixel(940),
Height = Unit.Percentage(100)
};
TestGrid.ToolBarSettings.ShowRefreshButton = true;
}
请任何人提供适合上述实施的实施示例/参考。