【发布时间】:2013-03-02 16:23:18
【问题描述】:
我需要将列动态加载到 Jqgrid 并尝试关注 jqGrid and dynamic column binding
我正在尝试使用 MVC。对于列名,我从表中获取(其中包含要在 GRID 中显示的列列表)并返回简单的 Json 数据。
我如何为 ColModel 实现。例如:我需要像这样动态发送 JSon 对象
{name: 'Airport', formatter: UrlFmatter, width: 95, align: "center", index: 'AIRPORT', searchoptions: { sopt: ['eq', 'ne', 'cn']} }
{name: 'Country', width: 100, align: "center", index: 'Country', searchoptions: { sopt: ['eq', 'ne', 'cn']} }
我的设计应该如何发送 json 来设置 colModel ?
我的 UrlFmatter 代码
function UrlFmatter(cellvalue, options, rowObject) {
return "<a href='DetailResult?airportname=" + options.rowId + "' >" + cellvalue + "</a>";
}
我如何根据您对格式化和取消格式化的回答进行写作? 谢谢
【问题讨论】:
-
您需要更改网格的状态准备好还是之前?
-
我需要从 DB 发送数据并将其分配给 COlModel
标签: asp.net-mvc jqgrid