Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty message in gridPanel

Tags:

grid

panel

extjs

I'm using Extjs gridPanel to display data. I want to show "No data..." message in gridPanel when no data available. How to do this ?.

I tried emptyText property but its not worked.

I think emptyText is for gridView not for gridPanel.

Please help me how to show empty data message in gridPanel.(I'm using gridPanel not grid View)

like image 753
nani1216 Avatar asked Oct 19 '10 05:10

nani1216


1 Answers

You answered your own question -- it is indeed a GridView property. So to specify it in the GridPanel (which uses a GridView internally) just do this:

myGrid = new Ext.GridPanel({
    viewConfig: {
        emptyText: 'No records'
    }
});

Per the comments below, you might also include deferEmptyText: false in the viewConfig for the text to render immediately (otherwise it waits until after the initial store load is complete).

like image 111
Brian Moeskau Avatar answered Oct 15 '22 20:10

Brian Moeskau