如何使dGrid实例占据其容器高度的100%?我可以使用CSS将".dgrid"分类div设置为特定高度,但是当我将其设置为100%时,它不会显示.
voi*_*ate 12
得到它了.
.dgrid {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: auto;
}
Run Code Online (Sandbox Code Playgroud)
(当然,在容器上有绝对/相对位置)
我认为支持的方法是使用.dgrid-autoheight css类。
require([
"dgrid/List",
"dgrid/OnDemandGrid",
"dgrid/Selection",
"dgrid/Keyboard",
"dojo/_base/declare",
"dgrid/test/data/createAsyncStore",
"dgrid/test/data/smallColorData",
"dojo/domReady!"
], function(List, Grid, Selection, Keyboard, declare, createAsyncStore, smallColorData){
window.grid = new (declare([Grid, Selection, Keyboard]))({
className: "dgrid-autoheight",
collection: createAsyncStore({ data: smallColorData }),
columns: {
col1: "Color",
col5: "R",
col6: "G",
col7: "B"
}
}, "grid");
});
Run Code Online (Sandbox Code Playgroud)
这是来自测试示例。
| 归档时间: |
|
| 查看次数: |
4037 次 |
| 最近记录: |