Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default [OPEN-1262][3.3] GridView emptyText not working at several levels.

    [OPEN-1262][3.3] GridView emptyText not working at several levels.


    In a simple Ext page paste this into Firebug:

    Code:
    Ext.getBody().update('');
    g = new Ext.grid.GridPanel({title:'Grid', width:600,height:400,
        columns: [],
        hideHeaders: true,
        store: new Ext.data.ArrayStore({fields:[]}),
        viewConfig: {
            emptyText: 'Nothing to see here!'
        },
        renderTo: Ext.getBody(),
    });
    No text displayed.

    So it turns out you have to refresh to get the display. And you HAVE TO defer the call, otherwise it still does not work:

    Code:
    Ext.getBody().update('');
    g = new Ext.grid.GridPanel({title:'Grid', width:600,height:400,
        columns: [],
        hideHeaders: true,
        store: new Ext.data.ArrayStore({fields:[]}),
        viewConfig: {
            emptyText: 'Nothing to see here!'
        },
        renderTo: Ext.getBody(),
    });
    g.view.refresh.defer(1, g.view);
    But see how it's wrapped? The body is not sized because there are no columns.

    emptyText should not rely on the body being sized to accomodate columns. It should mean that the body is fully expanded. I'm using this to display a fatal I/O error which meant that the grid could not be produced. We couldn't even look up the columns.

    So to display some error text in a GridPanel, you finally need the incantation:

    Code:
    Ext.getBody().update('');
    g = new Ext.grid.GridPanel({title:'Grid', width:600,height:400,
        columns: [{}],
        hideHeaders: true,
        store: new Ext.data.ArrayStore({fields:[]}),
        viewConfig: {
            forceFit: true,
            emptyText: 'Nothing to see here!' // I send exception.getLocalizedMessage in the JSON!
        },
        renderTo: Ext.getBody(),
    });
    g.view.refresh.defer(1, g.view);
    emptyText needs a more robust implementation.

    I managed to get my error through to the front end eventually:


  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,883
    Vote Rating
    101
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Hrmm we'll take a look at what you're saying about the body being sized.

    In regard to the grid and the view not refreshing immediately this is the out of the box behavior. Because you are using an ArrayStore that hasn't been loaded it doesn't know to apply the emptyText (bc the store hasn't been loaded). You can use the deferEmptyText configuration in conjunction with the unloaded store to immediately show the emptyText.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,883
    Vote Rating
    101
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Hrmm we'll take a look at what you're saying about the body being sized.

    In regard to the grid and the view not refreshing immediately this is the out of the box behavior. Because you are using an ArrayStore that hasn't been loaded it doesn't know to apply the emptyText (bc the store hasn't been loaded). You can use the deferEmptyText configuration in conjunction with the unloaded store to immediately show the emptyText.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    That makes sense! The Store has to have an attempted load to know that it is in fact empty, not just in a default state.

  5. #5
    Ext JS Premium Member
    Join Date
    Jun 2007
    Location
    Halifax, NS, Canada
    Posts
    24
    Vote Rating
    0
    TheCatWhisperer is on a distinguished road

      0  

    Default


    Another issue, is that id the results are "null" and not a empty array, it does not apply the emptyText...

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    That is a Reader issue, and it's a moot point as to whether it should handle that as you say.

    To correctly indicate that zero rows were returned as the result of a successful query which happened to yield zero rows, I suggest that it is necessary to receive a success packet containing a zero length array.

  7. #7
    Ext JS Premium Member
    Join Date
    Jun 2007
    Location
    Halifax, NS, Canada
    Posts
    24
    Vote Rating
    0
    TheCatWhisperer is on a distinguished road

      0  

    Default


    I'm happy you feel that way. But That doesn't necessarily mean it isn't a bug. IMO, returning no rows is more accurate then returning an empty array. I think it is a preference of a development team's code style.

    Also IMO, if something is "moot" or ambiguous, then it should be handled either way. Causes less frustration, and less confusion.

  8. #8
    Sencha User gskluzacek's Avatar
    Join Date
    Feb 2010
    Location
    Algonquin, IL
    Posts
    63
    Vote Rating
    3
    gskluzacek is on a distinguished road

      0  

    Default Any Solution to display messages when the grid has no records

    Any Solution to display messages when the grid has no records


    Animal,

    Was wondering if you found any better solution to display a message in the body of a Grid Panel when there are no data records to display than using the Grid View's emptyText attribute. I.e. in the case of an error or other condition that prevents the data from being retrieved.

    I my case I have a 'Search Results' Grid Panel that displays a number of records from the user's search along with a tab panel where individual tabs have additional Grid Panels. Depending on which record the user has selected in the search results gird panel, there may or may not be records to display in each of the various tabbed grid panels for multiple reasons (lots of optional child tables).

    I'd like to display a message in the active tab's gird panel (that would vary from record to record selected in the search results grid panel) and have been able to by setting deferEmptyText to false, changing the emptyText value, then calling refresh... but this seems like a kludge and I haven't been able to figure out how to add some padding to the grid panel to the message isn't right up against the top and left side of the grid panel.

    Any suggestions would be much appreciated.

    Regards,
    --Greg
    -- Once you go Mac, you never go back!

  9. #9
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You can just drop HTML into the View's el.

    Code:
    myGrid.getView().el.update('Boo!');

Similar Threads

  1. Updating a gridview's emptyText?
    By kmoncada in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 6 Feb 2009, 10:15 AM
  2. GridView and emptyText
    By sl5337 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 2 Oct 2008, 7:04 AM
  3. Replies: 3
    Last Post: 19 Jan 2008, 4:24 AM
  4. [2.0b1] GridView emptyText feature
    By tjcrowder in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 29 Oct 2007, 2:03 PM

Thread Participants: 3

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar