将ScrollPanel添加到CellTable

时间:2014-09-04 14:22:57

标签: java gwt

我想使用uibinder在我的gwt上使用scrollpanel制作celltable,但是无法显示此滚动面板。我尝试将scrollPanel添加到ui.xml文件中并添加此单元格:

<g:HTMLPanel>
  <table style='width:100%;'>
   <tr>
      <td valign='top'>
        <c:CellTable pageSize='10' styleName="cellTable" ui:field='Source'></c:CellTable>
      </td>
    </tr>
    <tr>
     <td align='center'>
        <c:SimplePager  ui:field='simplePager' location='CENTER'></c:SimplePager>
      </td>
     </tr>
  </table>
</g:HTMLPanel>

但是它没有显示任何滚动条,我尝试使用datagrid而不是像lidier的docklayoutpanel一样使用celltable:

<g:DockLayoutPanel
unit="EM">
<!-- DataGrid. -->
<g:center>
  <c:DataGrid
    ui:field='dataGrid' />
</g:center>

但是什么都没有显示在gui上,什么都没有。 有人可以建议我如何在我的ui.xml文件中添加scrollpanel到celltable吗?

编辑:

 <g:HTMLPanel>
  <table style='width:100%;'>
   <tr>
      <td valign='top'>
**<g:ScrollPanel>
        <c:CellTable pageSize='10' styleName="cellTable" ui:field='Source'></c:CellTable>
</g:ScrollPanel>**
      </td>
    </tr>
    <tr>
     <td align='center'>
        <c:SimplePager  ui:field='simplePager' location='CENTER'></c:SimplePager>
      </td>
     </tr>
  </table>
</g:HTMLPanel>

1 个答案:

答案 0 :(得分:1)

显示滚动条。您必须在滚动面板上定义高度。

<g:ScrollPanel height="500px">
    <c:CellTable pageSize='10' styleName="cellTable" ui:field='Source'></c:CellTable>
</g:ScrollPanel>