【问题标题】:Hide the column and show the field when edit or add in jqGrid在jqGrid中编辑或添加时隐藏列并显示字段
【发布时间】:2023-03-25 12:40:03
【问题描述】:

我有更多的 jqGrid 。所以需要隐藏 jqGrod 中的一些列(字段)。当我们编辑或添加需要在 jqgrid 中显示所有字段时编辑弹出窗口或添加弹出窗口。那么是否有任何属性。

代码:

    $("#Datasourcegrid").jqGrid({
              postData: { CAId: function () { return $('#hdnchnAppId').val(); } },
                colNames: ['DataSourceId', 'Title','Sort Order'],
                colModel: [
                            { name: 'DataSourceId', index: 'DataSourceId', align: 'left', key: true, editable: false, hidden: true, search:false,width: '10'},
                            { name: 'DataSourceTitle', index: 'DataSourceTitle', sortable: true, align: 'left', width: '400',editable: true, edittype: 'text', editrules: { required: true },stype:'text', search:true,searchoptions:{sopt:['eq']}},
                            { name: 'SortOrder', index: 'SortOrder', sortable: true, align: 'left', width: '100',editable: true, hidden: true, edittype: 'text', editrules:{number:true, required:true}, search:false},

 ],

【问题讨论】:

    标签: asp.net-mvc jqgrid


    【解决方案1】:

    您可以将edithidden:true 添加到hidden: true 列的editrules,查看编辑规则部分的jqgrid wiki 以获取更多选项。

    【讨论】:

      猜你喜欢
      • 2013-12-30
      • 2015-11-09
      • 1970-01-01
      • 2012-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多