2012-10-30 29 views
0

我想显示加载消息(正在加载...),该消息在填充数据网格时显示。在DataGrid中插入加载消息

它会显示何时搜索按钮被点击并在网格结果填充时消失。

我已经看到了一些可能的选项包括dojox.widget.Standby但是,它看起来像有一个已经嵌入dojox.grid.DataGrid

东西,我无法找到如何访问任何文件或显示在我的除了跨度标记之外的应用程序:

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

任何人都有幸在他们的应用程序中插入加载消息?我可以将标签放置在html中,但它没有必要的元素,只在点击搜索按钮时显示,并在搜索完成时消失。

回答

1

您有三个设置可以在DataGrid上应用于消息。

下面是默认设置:

// 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: "", 

因此,例如,您的数据加载时,你可以设置此类似:

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); 
+0

感谢。我如何获得默认显示?我原以为默认设置就可以开箱即用。 – Craig

+0

是的,默认值可以正常工作。但“默认”只是一个加载图标。 – Layke

+0

我感谢您的帮助。似乎无法得到任何东西火。 – Craig