【发布时间】:2012-08-21 09:08:04
【问题描述】:
我有这个 jqgrid
var grid = new JqGridHelper<VisualisationModel>(
"gridVisualizzazioni",
caption: null,
dataType: JqGridDataTypes.Json,
methodType: JqGridMethodTypes.Post,
pager:true,
sortingName: "IndicatoreVisualizzazioniPk",
sortingOrder: JqGridSortingOrders.Asc,
url: Url.Action("LoadGrid", new {
indicatorePk = Model.IndicatorePk
}),
autoWidth: true,
viewRecords: true,
loadComplete:"SetCellBackColor");
在我的模型中,我创建了一些列...
特别是
[Required]
[JqGridColumnFormatter(JqGridColumnPredefinedFormatters.Integer)]
public int AggregazioniDatiId { get; set; }
可以通过DataAnnotation隐藏jqGrid中的上述列吗?
我试过了
[ScaffoldColumn(false)]
但是在 colModel 中该列没有出现,然后我的 jquery 代码不起作用
var grid = $("#gridVisualizzazioni");
var selRowId = grid.jqGrid('getGridParam', 'selrow');
var celValue = grid.jqGrid ('getCell', selRowId, 'AggregazioniDatiId');
提前致谢。
萨拉
【问题讨论】:
-
[HiddenInput(DisplayValue = false)] 你试过这个吗?同样的错误?
-
或者在这个trirand.net/demoaspnetmvc.aspx 中,在他们对列使用editable:false 的模型中,您也可以使用hidden:true。我不知道你是如何构建你的网格的。
-
@PiyushSardana 谢谢。 [HiddenInput(DisplayValue = false)] 有效!
标签: jquery jqgrid data-annotations lib.web.mvc