简体   繁体   中英

Editablegrid - JSON init + hide columns

I have a php file that generates the following valid json string:

{
    "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.
on the other hand, using CSS I was able to hide it.
This can also come handy to style, size individual columns...

in the CSS (ie: demo.css) add :

.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..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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