您可以在 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 );