Gridのヘッダー部を非表示にする手順 | ExtJsへの道

Gridのヘッダー部を非表示にする手順

Gridのヘッダー部を非表示にする方法は1.1と2.0以降で異なります。
・1.1でのGridのヘッダー部を非表示にする方法
grid.render()の後ろに以下の一文を追加します。
grid.getGridEl().select('.x-grid-header').setStyle('display','none');

・2.0でのGridのヘッダー部を非表示にする方法
configOptionでhideHeadersをtrueに設定します。
// create the Grid
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{id:'company',header: "Company", width: 160, sortable: true, dataIndex: 'company'},
{header: "Price", width: 75, sortable: true, renderer: 'usMoney', dataIndex: 'price'},
{header: "Change", width: 75, sortable: true, renderer: change, dataIndex: 'change'},
{header: "% Change", width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'},
{header: "Last Updated", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
],
stripeRows: true,
autoExpandColumn: 'company',
height:350,
width:600,
title:'Array Grid',
hideHeaders:true
});