Dojo Dgrid子视图即使已定义,也不会显示
我正在使用上面的代码创建dgrid。我已经在我的基本html中加载了dojo.css、claro.css和dgrid.css。但是由于某些原因,子窗口没有呈现在我的屏幕上。我可能错了,但我很确定这是一个愚蠢的错误,现在是:Dojo Dgrid子视图即使已定义,也不会显示,dojo,dgrid,Dojo,Dgrid,我正在使用上面的代码创建dgrid。我已经在我的基本html中加载了dojo.css、claro.css和dgrid.css。但是由于某些原因,子窗口没有呈现在我的屏幕上。我可能错了,但我很确定这是一个愚蠢的错误,现在是: this.grid = new CustomGrid({ collection: this.store, subRows: [ [
this.grid = new CustomGrid({
collection: this.store,
subRows: [
[
{ field: 'first', label: 'First', rowSpan: 2 },
{ field: 'last', label: 'Last', rowSpan: 2 },
{ field: 'bats', label: 'Bats', rowSpan: 2 },
{ field: 'throws', label: 'Throws', rowSpan: 2 },
{ field: 'totalG', label: 'G' },
{ field: 'totalAB', label: 'AB' },
{ field: 'totalR', label: 'R' },
{ field: 'totalRBI', label: 'RBI' },
{ field: 'totalBB', label: 'BB' },
{ field: 'totalK', label: 'K' }
],
[
{ field: 'totalGAB', label: 'Games as Batter', colSpan: 2 },
{ field: 'totalH', label: 'H' },
{ field: 'total2B', label: '2B' },
{ field: 'total3B', label: '3B' },
{ field: 'totalHR', label: 'HR' }
]
],
showHeader: true,
className: 'dgrid-autoheight',
showFooter: false,
selectionMode: "none",
loadingMessage: "Loading form...",
noDataMessage: "No Skill in this form"
});
在该上下文中,此
指的是CustomGrid
对象。您可能已经加载了存储,并且存储在另一个上下文(实例化网格的上下文)中的属性中。如果不加载存储,则无法呈现数据,因为网格中不会有数据
因此,基本上,简单的解决方法是:
collection: this.store
希望能有所帮助。谢谢,但这不是原因。问题在于dgrid扩展的定义顺序。
var self = this;
this.grid = new CustomGrid({
collection: self.store
// all other grid properties
});