View Full Version : Problem about grid cannot display the header

24 Jan 2008, 12:44 AM
Refer to example from ExtJS, I've just start to build a xml grid, I using the Ext.data.HttpProxy to capture database and write to xml file, it is success to display all data, but I cannot make it to show the header and so it cannot apply function of sorting also another feature. Can someone tell me which part I got wrong? Thank you very much.

here is my code


Ext.state.Manager.setProvider(new Ext.state.CookieProvider());

var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'listserver2_bn.jsp?method=post'}),
//url: 's_output.xml',
reader: new Ext.data.XmlReader({
record: 'S_STATUS',
id: 'ids_status',
}, [
{name: 'units', mapping: 'units'},
'service', 'IP', 'run_day', 'submit_date', 'remarks'

//var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
{id:'units',header: "單位", width: 70, sortable: true, dataIndex: 'units'},
{header: "IP位置", dataIndex: 'IP'},
{header: "執行服務", width: 70, dataIndex: 'service'},
{header: "連續工作", width: 70, dataIndex: 'run_day', sortable: true},
{header: "匯報時間", dataIndex: 'submit_date', sortable: true},
{header: "備註", width: 350, dataIndex: 'remarks'}

var grid = new Ext.grid.GridPanel({
store: store,
cm: cm,
/*tbar: new Ext.PagingToolbar({
pageSize: 20,
store: ds,
displayInfo: true,
displayMsg: '顯示第 {0} 條到 {1} 條記錄,一共 {2} 條',
emptyMsg: "沒有記錄"
renderTo: 'grid',

Sorry for my bad english.....:">

24 Jan 2008, 12:50 AM
It looks like you are centering your grid.

If you are, please read this thread (http://extjs.com/forum/showthread.php?t=22324).

24 Jan 2008, 1:13 AM
Thank you so much, you are great :D

8 Feb 2008, 8:10 PM
Can I set the grid position center in the page......without using align.....something:">