2012-10-30 25 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