【问题标题】:How to add vertical scrollbar to dojox.grid.DataGrid?如何将垂直滚动条添加到 dojox.grid.DataGrid?
【发布时间】:2011-07-27 11:22:04
【问题描述】:

如何给dojox.grid.DataGrid添加垂直滚动条?

<div id="system_status" >
                    <div dojoType="dojo.data.ItemFileReadStore" jsId="system_flags"    data="window.store_data_system_flags"> </div> 
                    <div id="grid"  dojoType="dojox.grid.DataGrid" store="system_flags"   structure="window.layout_system_flags" queryOptions="{deep:true}" query="{}" clientSort="true" rowsPerPage="10"> </div>
                </div>

【问题讨论】:

  • 如果您使用 CSS 正确控制封闭 HTML 元素的大小,则应该会出现垂直滚动条,在这种情况下为 div

标签: dojo dojox.grid.datagrid


【解决方案1】:

只需为 id 为 "system_status" 的 div 设置 CSS "height" 样式,如果网格需要比滚动条更多的空间,则会自动出现。

<div id="system_status" style="height:200px" >
                    <div dojoType="dojo.data.ItemFileReadStore" jsId="system_flags"    data="window.store_data_system_flags"> </div> 
                    <div id="grid"  dojoType="dojox.grid.DataGrid" store="system_flags"   structure="window.layout_system_flags" queryOptions="{deep:true}" query="{}" clientSort="true" rowsPerPage="10"> </div>
                </div>

dojo-grid-styling

【讨论】:

    【解决方案2】:

    我发现我可以添加这种样式来覆盖可能会切断网格底部任何内容的 dojo 样式:

    .dojoxGridContent {
        overflow: auto;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多