Results 1 to 3 of 3

Thread: How to center emptyText inside grid dataView?

  1. #1
    Ext User
    Join Date
    Dec 2007
    Posts
    42
    Vote Rating
    0
      0  

    Default 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!

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default

    Does your grid have a fixed height?

    In that case you can assign a custom class to your grid, e.g.
    Code:
    var grid = new Ext.grid.GridPanel({
      cls: 'my-grid',
      ...
    });
    and use a CSS rule:
    Code:
    .my-grid .x-grid-empty {text-align: center; padding-top: <nnn>px;}
    (<nnn> = half of grid minus text height)

    If the grid doesn't have a fixed width the you would need to calculate the offset (override the applyEmptyText method).

  3. #3
    Ext User
    Join Date
    Dec 2007
    Posts
    42
    Vote Rating
    0
      0  

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •