Search status with datagrid

695
4
Jump to solution
10-29-2012 06:48 AM
CraigMcDade
Occasional Contributor III
Its taking approx 10 seconds to run through my parcel search using the datagrid. I'm ok with this since its a fairly large database. Is there a good way to add a status bar (spinning circle, percentage, searching...) to the datagrid to let the user know that the search is being performed and then disappears when the search is complete?

So far the best I can find is dojox.widget.Standby. Would this be a good fit to integrate into the datagrid code? If so, I'm a little confused on where to put the hide after the search is complete.
0 Kudos
1 Solution

Accepted Solutions
CraigMcDade
Occasional Contributor III
Thanks. I had actually just ran across that and have successfully inserted the loading message in the sample referenced in my first post using:

grid.hideMessage("Loading...");

and
grid.showMessage("Loading...");
.

Now trying to edit that sample code so that it references and displays my data in the grid. Surprisingly more difficult than I would have thought.

View solution in original post

0 Kudos
4 Replies
CraigMcDade
Occasional Contributor III
in my research it looks like there is a default loading message built into the dojox.grid.DataGrid

 // loadingMessage: String
    //  Message that shows while the grid is loading
    loadingMessage: "<span class='dojoxGridLoading'>${loadingState}</span>"


I'm trying to access it in the sample without much success. Any ideas? Wouldn't it make sense for this to be visible by default?
0 Kudos
__Rich_
Occasional Contributor III
Looks like the DataGrid automatically shows that string (or whatever has been assigned to the loadingMessage property) but only under certain conditions during a call to the internal _fetch implementation:

_fetch: function(start, isRender){
  start = start || 0;
  if(this.store && !this._pending_requests[start]){
   if(!this._isLoaded && !this._isLoading){
    this._isLoading = true;
    this.showMessage(this.loadingMessage);
   }
<snip>

But since showMessage() is a public method so you could call it from your code at the appropriate points?

Have a look at:

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/fl_paging.html
0 Kudos
CraigMcDade
Occasional Contributor III
Thanks. I had actually just ran across that and have successfully inserted the loading message in the sample referenced in my first post using:

grid.hideMessage("Loading...");

and
grid.showMessage("Loading...");
.

Now trying to edit that sample code so that it references and displays my data in the grid. Surprisingly more difficult than I would have thought.
0 Kudos
__Rich_
Occasional Contributor III
Have you thought about using dGrid instead?
0 Kudos