We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Hide column header in ejGrid

hello, i need to hide the column header (<th) in my ejGrid, can you help me with that please. This is my code:

<body>
<div id="Grid"></div>
<table id="Table1">
<colgroup>
<col />
<col />
</colgroup>
<thead>
<tr>
<th>Medición
</th>
<th>Valor
</th>
 </tr>
</thead>
<tbody>
<tr>
 <td>m/s</td>
<td>236</td>
 </tr>
<tr>
<td>km/h</td>
<td>14-54</td>
</tr>
</tbody>
</table>
</body>

<script>
$(function () {
        $("#Grid").ejGrid({
            dataSource: ej.DataManager($("#Table1")), width: 130,
            ShowColumnHeaders :false,
            columns: [
                    { field: "Medición", headerText: "Medición", width: 70 },
                    { field: "Valor", headerText: "Valor", width: 50 }
            ]
        });
    });
</script>

Thanks

1 Reply

IR Isuriya Rajan Syncfusion Team August 18, 2015 02:12 PM UTC

Hi Julio,

Thanks for using Syncfusion products.


Your requirement “Hide column header in ejGrid “can be achieved by using the create event where you can the grid elements at the initial state itself. Also you can get the grid header element by using the getHeaderContent method

 

function create(args) {

this.getHeaderContent().hide()

}

Please refer the below sample,
http://www.syncfusion.com/downloads/support/directtrac/119943/New_Compressed_(zipped)_Folder_(4)-2115233515.zip


Please refer the below help document to know how we can use getHeaderContent method in Grid,
API-Reference

  

Please let us know if you require further assistance on this.

Regards,

Isuriya R



Loader.
Live Chat Icon For mobile
Up arrow icon