-
29 Jan 2009 9:45 PM #1
How to center emptyText inside grid dataView?
How to center emptyText inside grid dataView?
Is there anyway we can display emptyText in the center of dataView instead of in the upper left corner? Any help would be really appreciated.
Thank!
-
29 Jan 2009 11:52 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 43
Does your grid have a fixed height?
In that case you can assign a custom class to your grid, e.g.
and use a CSS rule:Code:var grid = new Ext.grid.GridPanel({ cls: 'my-grid', ... });
(<nnn> = half of grid minus text height)Code:.my-grid .x-grid-empty {text-align: center; padding-top: <nnn>px;}
If the grid doesn't have a fixed width the you would need to calculate the offset (override the applyEmptyText method).
-
30 Jan 2009 7:50 PM #3
Thank you Condor for your response. The grid does not have a fixed height, it is located in region which has fit layout. Would your solution applies to this case as well?
Thanks!
Mohamed


Reply With Quote