2017-04-12 53 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擴展的順序。 –

相關問題