1

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?

mpromonet
  • 11,326
  • 43
  • 62
  • 91
laloune
  • 548
  • 1
  • 9
  • 26
  • What do you mean by hide? You want to delete all names and labels? – PHPhil Jul 21 '15 at 17:06
  • 1
    I just would like them to be not shown but there tough. from my point of view this is a relevant question cause when you get data from a db table you may have columns that are not relevant to show (id of the row for instance) but that you still need (for instance to delete the row you will need the id) – laloune Jul 22 '15 at 07:27
  • +1 I am also looking for a solution to this, perhaps I will give up with editablrgrid and move to handsontable – mpromonet Jul 23 '15 at 15:54
  • I rethought about it and it turns out that this is not necessary. The idea is then not to display the column. I used the id in an hyperlink, that worked well – laloune Jul 29 '15 at 09:47

1 Answers1

0

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