2017-04-12 50 views
0
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" 

     }); 

我正在使用上面的代码创建一个dgrid.I已经在我的基础html.But中加载了dojo.css,claro.css和dgrid.css原因这些亚行不在我的屏幕上呈现。即使它们被定义也不会出现Dgrid亚行

回答

0

我可能是错的,但我敢肯定,这是一个愚蠢的错误,那就是:

collection: this.store 

在这种情况下,thisCustomGrid对象。您可能已经在之前加载了存储,并将其存储在另一个上下文(实例化网格的上下文)中的属性中。如果您没有加载商店,则无法呈现数据,因为它不会出现在网格中。

所以,基本上,简单的解决方法是:

var self = this; 
this.grid = new CustomGrid({ 
    collection: self.store 
    // all other grid properties 
}); 

希望它帮助。

+0

谢谢,但这不是原因。问题在于定义了dgrid扩展的顺序。 –

相关问题