Tore
Tore

Reputation: 171

jqGrid without header

I have tried to figure out how to disable the header for a jqGrid, so that the row containing the column names does not show. So far, I have come up with no solution. Is there any way to do this?

Upvotes: 8

Views: 24423

Answers (6)

Sakthikanth
Sakthikanth

Reputation: 139

This code works for me for jqGrid version 5.7

var tableId = document.getElementById('gridTablId').getAttribute("aria-labelledby");
document.querySelector("#" + tableId + " .ui-jqgrid-htable thead").style.display = "none";

Upvotes: 0

Pieter
Pieter

Reputation: 2239

Omitting the 'caption' property hides the header.

Very late I know, but for someone still wanting to know. This was found after looking through the source.

Upvotes: 16

Whelkaholism
Whelkaholism

Reputation: 1495

Not sure why no-one has come up with the CSS solution yet...

.ui-jqgrid-hdiv {
  display:none !important;
}

You can scope it using a wrapper container for a single instance if you have other grids that shouldn't be affected.

Upvotes: 1

utsavized
utsavized

Reputation: 126

This works:

var grid = $("#GRID_NAME");
var gview = grid.parents("div.ui-jqgrid-view");
gview.children("div.ui-jqgrid-hdiv").hide();

Upvotes: 2

imdadhusen
imdadhusen

Reputation: 2494

There is an option for this: hidegrid: false

look at following Is it possible to remove the expand/collapse button from the jqGrid header?

Upvotes: -1

tvanfosson
tvanfosson

Reputation: 532435

I don't see that the plugin gives you any options for this, but you could simply find and hide the container for the header.

...set up grid...

$('.ui-jqgrid-hdiv').hide();

Upvotes: 17

Related Questions