jqgrid | 珊瑚贝

jqgrid & Lib.Web.Mvc.JQuery.JqGrid.DataAnnotations:how hide column?


我有这个 jqgrid

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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”);

在我的模型中,我创建了一些列…

特别是

1
2
3
[Required]
[JqGridColumnFormatter(JqGridColumnPredefinedFormatters.Integer)]
public int AggregazioniDatiId { get; set; }

是否可以通过DataAnnotation隐藏jqGrid中的上述列?

我试过

1
[ScaffoldColumn(false)]

但在 colModel 中该列不出现,然后我的 jquery 代码不起作用

1
2
3
var grid = $(“#gridVisualizzazioni”);
var selRowId = grid.jqGrid(‘getGridParam’, ‘selrow’);
var celValue = grid.jqGrid (‘getCell’, selRowId, ‘AggregazioniDatiId’);

提前致谢。

萨拉

  • [HiddenInput(DisplayValue = false)] 你试过这个吗?同样的错误?
  • 或者在这个 trirand.net/demoaspnetmvc.aspx 中,在他们对列使用可编辑:假的模型中,您也可以使用隐藏:真。我不知道你是如何构建你的网格的。
  • @PiyushSardana 谢谢。 [HiddenInput(DisplayValue = false)] 有效!


试试这个:

1
[HiddenInput(DisplayValue = false)]

来源:https://www.codenong.com/12051603/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_8967.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?