这是我的 Flexigrid:
$("#grUser").flexigrid({
url: 'someJSON.php'
, dataType: 'json'
, colModel :
[
{display: '', name : 'Index', width :100, align: 'left'}
, {display: '', name : 'Value', width : 100, align: 'left'}
]
, title: 'Details'
, width: 350
, height: 200
, singleSelect: true
});
标题中的显示/隐藏列功能确实很酷,但是我想指定可用的列,并且我无法找到有关我的选项的良好文档在指定 colModel 时。这里
{display: '', name : 'Index', width :100, align: 'left'}
我们还可以在列的定义中添加什么?
此外 - Flexigrid 的文档来源是什么?
最佳答案
不幸的是,这方面的文档不存在,因此非常令人沮丧。你必须查看源代码,看看你能做什么。
只需添加“hide: true”,如下所示。将 hide 设置为 true,将隐藏一列。
{display: 'Row ID', name : 'id', width : 100, sortable : true, align: 'left', hide: true}
您可以设置以下属性:
- 显示
(这是用于列标题的内容)
name
(这是用于 Ajax 调用的数据库字段名称)宽度
高度
可排序
:真/假对齐
:左/中/右隐藏
:真/假可搜索
:true/false(仅在您打开搜索栏时适用)
关于jQuery 的 Flexigrid 在标题中显示/隐藏列功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1542176/