javascript - jqGrid 中的隐藏列

标签 javascript jquery jqgrid

有什么方法可以隐藏 jqGrid 表中的列,但在表单编辑器模式对话框中编辑该行时将其显示为只读?

最佳答案

此功能内置于 jqGrid 中。

按如下方式设置您的网格函数。

$('#myGrid').jqGrid({
   ...
   colNames: ['Manager', 'Name', 'HiddenSalary'],
   colModel: [               
               { name: 'Manager', editable: true },
               { name: 'Price', editable: true },
               { name: 'HiddenSalary', hidden: true , editable: true, 
                  editrules: {edithidden:true} 
               }
             ],
   ...
};

还有其他可以应用的编辑规则,但此基本设置会在 GridView 中隐藏经理的薪水,但会在显示编辑表单时允许编辑。

关于javascript - jqGrid 中的隐藏列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1661800/

相关文章:

javascript - jQuery/CoffeeScript/Rails 不会在我的输入上调用change()

jquery - 让 gps 脚本运行一次,不需要停止和启动按钮

jquery - jqGrid 列与列标题不对齐

jquery - jqgrid 和 jqPivot : How to remove grouping when xDimension have multi value?

javascript - $.post 和 $.get 只允许更改标题,不记录日志?

jquery - jqgrid刷新网格按钮不传递过滤器

javascript - d3js - 将父元素添加到选择中

javascript - 通过将 HTML 元素附加到 URL 来定位页面的特定部分

javascript - 如何知道是否正在加载javascript youtube iframe api

javascript - 帮助更改 javascript/jquery 中的索引