简体   繁体   English

Editablegrid-JSON初始化+隐藏列

[英]Editablegrid - JSON init + hide columns

I have a php file that generates the following valid json string: 我有一个生成以下有效json字符串的php文件:

{
    "metadata": [
        {
            "name": "change_id",
            "label": "changeId",
            "datatype": "string",
            "editable": false,
            "hide": true
        },
        {
            "name": "change_parent_id",
            "label": "changeParentId",
            "datatype": "string",
            "editable": false,
            "hide": true
        },
        {
            "name": "change_date",
            "label": "Date",
            "datatype": "string",
            "editable": false,
            "hide": true
        },
        {
            "name": "change_user",
            "label": "User",
            "datatype": "string",
            "editable": false,
            "hide": true
        }
    ],
    "data": [
        {
            "id": 1,
            "values": [
                "test",
                "test",
                "test",
                "test"             
            ]
        }
    ]
}

I would like to hide the 2 first columns, what would be the property to set in the metadata object? 我想隐藏前两列,在元数据对象中设置的属性是什么?

Old thread but as I was looking for the answer I am posting what I found. 旧线程,但是当我寻找答案时,我正在发布我发现的内容。 there is a "hidden" parameter in the js scripts but I could never make that work. js脚本中有一个“隐藏”参数,但我永远无法做到这一点。
on the other hand, using CSS I was able to hide it. 另一方面,使用CSS可以隐藏它。
This can also come handy to style, size individual columns... 这也可以派上用场,调整单个列的大小...

in the CSS (ie: demo.css) add : 在CSS(即demo.css)中添加:

.editablegrid*columnName
{
   display: none;
}

ie: I have a column Title that I want to hide and a column progress which I am styling a bit : 即:我有一个要隐藏的标题栏和一个正在设置样式的栏进度

/* Styling columns */
.editablegrid-Title {
  display: none;
}
.editablegrid-progress {
  text-align: center;
  width: 80px;
  background-color: green; 

}

Hope this will help someone else.. 希望这会帮助别人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM