View Full Version : Custom message when a Paged Grid is empty

29 Dec 2006, 2:04 AM

I have a small query. I am using a paged grid, and when there are no rows in the response, the "loading" image keeps on rotating, giving a false impression that the data is being fetched. I dont want that. I want that it should stop rotating when there is no data. How can this be done?

Moreover, is there any way of displaying a custom message like "No records found" in the grid area when there are no rows?


29 Dec 2006, 10:37 AM
After the load completes (or errors) look to see if there are any rows in the data model. If there are, just update the grid.getView().getBodyTable() with your message.

29 Dec 2006, 10:40 AM
Hey thanx for the quick reply Jack. And how do I stop the rotating refresh icon??

29 Dec 2006, 10:41 AM
That generally means an error occured. You should probably try to figure out what happened. :)

29 Dec 2006, 10:42 AM
The event is "loadexception"on the data model.

29 Dec 2006, 10:48 AM
thanx a ton man.... I was stuck on this for quite some time now :)

30 Jan 2007, 5:57 AM
I've found that returning an empty string where the results array would be causes the spinner to stop after loading. My JSON looks like:


30 Jan 2007, 6:00 AM
Well, anything which has a "length" property of zero will suffice really, since the grid attempts to read it as an Array from element 0 to element length-1! Strictly, it should be


31 Jan 2007, 5:01 AM
I think we had a similar problem.


22 Oct 2007, 9:05 AM
Hello everyone

i am trying to set the "No Record found" on my grid
i tried the following two approaches


grid.view.mainBody.update("<div style='height:75px; font:11px arial, helvetica;padding:20px;'>no-search</div>");


grid.getView().getBodyTable('No Record found');

but its not appearing on my gird
Please advice if i am missing anything.

Guru Singh

22 Oct 2007, 9:15 AM
Please don't resurrect ancient threads to ask a question, the code has changed considerably since then - post a new question. Have you tried Brian's rec from this thread? http://extjs.com/forum/showthread.php?t=15777&highlight=emptyText

22 Oct 2007, 9:29 AM
Thanks i will do that