2012-11-01 21 views

回答

1

把DijitRegistry添加到網格中,如下所示:

https://github.com/SitePen/dgrid/wiki/DijitRegistry

把dijit的集裝箱在你的內容窗格(如果窗格是必要的),並添加網格作爲容器的孩子。該容器將調用其子項的啓動,並調整它們的大小。

+0

Hooray我在stackoverflow上做了一些有用的事情! – KyJoHo

0

因此,我爲ContentPane添加了一個onShow事件處理程序,該程序持有我的網格,每當它觸發時它就會調用grid.resize()。簡單,但它的作品。

0

剛解決的問題。 所以,我的問題是: 我編程添加dgrid到dijit/layout/ContentPane。在其他瀏覽器中,除了IE 6以外,它的工作狀況還不錯。它沒有顯示dgrid unti我調整瀏覽器的窗口大小。我使用了StackOverflow和其他站點的許多解決方案。直到我沒有替換我的網格的css規則(在一個Stacks的解決方案中找到)。

帶我找到下一個CSS規則:

#dataGrid { 
position: absolute; 
top: 0; 
bottom: 0; 
left: 0; 
right: 0; 
height: auto; 
width: auto; 
} 

其確定,但不是在IE6。 我改爲:在我所有的測試瀏覽器

#dataGrid { 
width: 100%; 
height:100%; 
} 

而其確定現在。 希望我幫你:) 共增加工作dgrid(道場1.9):

HTML (my container): 
<div class="centerPanel" id="centerPanel" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" ></div> 

JS (I skipped reuires): 
grid = new (declare([OnDemandGrid, DijitRegistry, ColumnResizer,Keyboard, Selection]))({ 
    columns: docListLayout,id:"dataGrid" 
}); 
registry.byId("centerPanel").addChild(grid); 

CSS: 
#dataGrid { 
width: 100%; 
height:100%; 
} 

此外,我除去CSS我centerPanel與寬度/高度聲明。

CU。

相關問題