0

I'd like to show a loading message (Loading...) that shows while the datagrid is being populated.

It would show when the search button is clicked and disappear when the grid results have populated.

I've seen a few possible options including dojox.widget.Standby however, it looks like there is something that is already embedded in the dojox.grid.DataGrid

I can't find any documentation on how to access it or show it in my app except for a span tag:

<span class="dojoxGridLoading">Loading...</span>

Anybody had any luck inserting a loading message in their app? I can place the tag in the html but it doesn't have the necessary elements to only show up on click of the search button and disappear when the search is complete.

Craig
  • 229
  • 5
  • 20

1 Answers1

1

You have three settings that you can apply on the DataGrid for messages.

Here are the defaults:

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

    // errorMessage: String
    //  Message that shows when the grid encounters an error loading
    errorMessage: "<span class='dojoxGridError'>${errorState}</span>",

    // noDataMessage: String
    //  Message that shows if the grid has no data - wrap it in a
    //  span with class 'dojoxGridNoData' if you want it to be
    //  styled similar to the loading and error messages
    noDataMessage: "",

So for example, when your Data is loading, you can set this up like:

new EnhancedGrid({ // This can be DataGrid() also..
                    structure: layout,
                    store : store,
                    noDataMessage: "No Items Found.",
                    loadingMessage: "<span class='dojoxGridLoading'>Loading Really Awesome Stuff</span>"                        
                }, node );
Layke
  • 51,422
  • 11
  • 85
  • 111