加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc – 隐藏列并在编辑时显示字段或在jqGrid中添加

发布时间:2020-12-16 06:27:05 所属栏目:asp.Net 来源:网络整理
导读:我在jqGrid中有更多的colimns.所以需要隐藏jqGrod中的一些列(字段).当我们编辑或添加需要在jqgrid编辑弹出窗口中显示所有字段或添加弹出窗口时.那么这有什么属性吗? 代码: $("#Datasourcegrid").jqGrid({ postData: { CAId: function () { return $('#hdnc
我在jqGrid中有更多的colimns.所以需要隐藏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,width: '400',editable: true,edittype: 'text',editrules: { required: true },stype:'text',search:true,searchoptions:{sopt:['eq']}},{ name: 'SortOrder',index: 'SortOrder',width: '100',editrules:{number:true,required:true},search:false},],

解决方法

您可以在hidden:true列的editrules中添加edithidden:true,检查editrules部分的 jqgrid wiki以获取更多选项.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读