1. #1
    Sencha User VDP's Avatar
    Join Date
    Feb 2012
    Location
    Boom, Belgium
    Posts
    85
    Answers
    3
    Vote Rating
    9
    VDP will become famous soon enough

      0  

    Default Answered: [Ext 4.2.0] issue with grids emptyText + minHeight of grid is causing layout faillure

    Answered: [Ext 4.2.0] issue with grids emptyText + minHeight of grid is causing layout faillure


    I have a grid on a form in a fieldset. When the grid is shown with an empty store I want it to show the emptyText.

    By default it doesn't. (also didn't in < Ext 4.2.0 ). I had a work around. When the form is shown (for the first time) I refresh the view. ( grid.view.refresh() )

    But in the new Ext 4.2.0 there is no height. So I set a minHeight on the grid.

    That minHeight is causing a layout failure now...

    Any suggestions? Is this a bug? (If yes please move to bug section)

    Here is a 'working' fiddle: http://jsfiddle.net/Vandeplas/C4qen/

    UPDATE:

    I used the solution Farish uses, setting the emtpyText inside the viewConfig. And I set the minHeight in the viewConfig in staid of directly on the grid.

  2. For your first problem with the emptyText, the following will fix it:

    http://docs.sencha.com/ext-js/4-0/#!...deferEmptyText

    In your grid:
    Code:
    //emptyText: 'No locations for this group',
    viewConfig: { emptyText: 'No locations for this group', deferEmptyText: false },

  3. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,094
    Answers
    112
    Vote Rating
    96
    Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light

      1  

    Default


    For your first problem with the emptyText, the following will fix it:

    http://docs.sencha.com/ext-js/4-0/#!...deferEmptyText

    In your grid:
    Code:
    //emptyText: 'No locations for this group',
    viewConfig: { emptyText: 'No locations for this group', deferEmptyText: false },

  4. #3
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,094
    Answers
    112
    Vote Rating
    96
    Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light

      0  

    Default


    if the grid is the only item in your form panel, using layout: 'fit' for the form panel and removing the minHeight from the grid will remove the error

  5. #4
    Sencha User VDP's Avatar
    Join Date
    Feb 2012
    Location
    Boom, Belgium
    Posts
    85
    Answers
    3
    Vote Rating
    9
    VDP will become famous soon enough

      0  

    Default


    Thanx for the first problem Thats a better fix than calling the refresh method. However the height is still 0.

    I can't set my layout to 'fit'. But if I set a minHeight on the viewConfig it's fixed!

  6. #5
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Answers
    1
    Vote Rating
    110
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Here is a bug report related to the problem.
    http://www.sencha.com/forum/showthread.php?260680
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

Thread Participants: 2

Tags for this Thread