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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hide column header in ejGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

119943 Aug 18,2015 01:55 AM UTC Aug 18,2015 02:12 PM UTC JavaScript 1
loading
Tags: ejGrid
Julio
Asked On August 18, 2015 01:55 AM UTC

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

Isuriya Rajan [Syncfusion]
Replied On 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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;