PDA

View Full Version : How to set gridpanel header direction



panbayi
4 Sep 2013, 5:04 AM
I hope to show the gridpanel's header text vertical,but i don't know which config can do this.Can anyone help me?

Any suggestion is appreciated!

scottmartin
4 Sep 2013, 5:48 AM
Something like this?



Ext.create('Ext.grid.Panel', {
title : 'Simpsons',
store : Ext.data.StoreManager.lookup('simpsonsStore'),
headerPosition: 'left',
columns : [
{ header : 'Name', dataIndex : 'name' },
{ header : 'Email', dataIndex : 'email', flex : 1 },
{ header : 'Change', dataIndex : 'change', tdCls : 'x-change-cell' }
],
height : 200,
width : 400,
renderTo : Ext.getBody()
});


Scott.

panbayi
20 Sep 2013, 7:06 AM
Thank you for your reply,scott!
I'm sorry I did not make myself clear.What I want to do is set the the text header of a column vertical beacause I have too many columns in a grid and the header is too long while I don't want user to scroll the scrollbar to view the whole gridpanel.Now I make a compromise,but I come up with a new problem : how to automatically adjust the width of a column according to the length of the header?
Apologise for my poor English.

Something like this?



Ext.create('Ext.grid.Panel', {
title : 'Simpsons',
store : Ext.data.StoreManager.lookup('simpsonsStore'),
headerPosition: 'left',
columns : [
{ header : 'Name', dataIndex : 'name' },
{ header : 'Email', dataIndex : 'email', flex : 1 },
{ header : 'Change', dataIndex : 'change', tdCls : 'x-change-cell' }
],
height : 200,
width : 400,
renderTo : Ext.getBody()
});


Scott.

scottmartin
20 Sep 2013, 8:21 AM
Perhaps I do not understand .. if you sent the column text on end, then it will basically be the width of a single letter ... and then you would have to account for the length of multiple columns having different titles.

You would have to create something for this yourself. IF you want to have multiple fields and do not want to scroll, you may want to consider using multiple views where you reconfigure the grid to show different views or use column grouping.

Scott

panbayi
21 Sep 2013, 3:32 AM
Thank you for you advice,scott!

Perhaps I do not understand .. if you sent the column text on end, then it will basically be the width of a single letter ... and then you would have to account for the length of multiple columns having different titles.

You would have to create something for this yourself. IF you want to have multiple fields and do not want to scroll, you may want to consider using multiple views where you reconfigure the grid to show different views or use column grouping.

Scott