View Full Version : How to add Pretty Grid Message when no rows in a GridPanel are available to display.

3 Jul 2010, 4:26 AM
Hi there,

I have a nice Grid Panel displaying information to a user, see image attached.

I would like to display a nice row within the Grid Panel when no rows exist to view. I already have the pagenation toolbar display a message no data to display, but I dont want the grid to simply look empty, My JSON could return N/A is each column but this is not Pretty which is not the EXTJS way, I am looking for an answer to be able to display
"No Data currently Exists" which spans all the columns in the Grid and is displayed in the center. I could of course check the count of the JSON and display a different DIV and not display the Grid At all, but I do want to show the grid. Any help much appreciated.


3 Jul 2010, 5:28 AM
First you set the emptyText:

viewConfig: {
emptyText: 'No data currently exists'
Next, you probably have to tweak the x-grid-empty css and the applyEmptyText method to get it to display in the center.

3 Jul 2010, 8:55 AM
Condor - Perfect, I know I had seen a parameter for it, but could not find it.