简体   繁体   English

GWT-Ext EditorGridPanel渲染问题

[英]GWT-Ext EditorGridPanel rendering problem

I am using GWT 1.6.4 and GWT-Ext 2.0.6. 我正在使用GWT 1.6.4和GWT-Ext 2.0.6。 I am trying to use EditorGridPanel and facing rendering problems. 我正在尝试使用EditorGridPanel并面临渲染问题。

When the module loads I create a Panel (TopPanel) with BorderLayout and add that to the ViewPort. 当模块加载时,我使用BorderLayout创建一个Panel(TopPanel)并将其添加到ViewPort。 I then create another Panel (CenterPanel) and add EditorGridPanel, three buttons to the center of the BorderLayout Panel (TopPanel). 然后,我创建另一个面板(CenterPanel)并向边界布局面板(TopPanel)的中心添加三个按钮EditorGridPanel。 I tried many layouts for CenterPanel but still not able to get what I want. 我为CenterPanel尝试了许多布局,但仍然无法获得我想要的。

I want the table to showup with the required data and scrollbars. 我希望表格显示所需的数据和滚动条。 All the three buttons comes below the table. 这三个按钮都在桌子下面。 The data for the table come via Async call when the module loads, so when the screen is rendered to the user, the data is populated in the table. 当模块加载时,表的数据通过Async调用来获得,因此,当向用户呈现屏幕时,数据将填充到表中。 But looks like the table gets rendered with no data and when the async process finishes the table gets populated but don't get resized to fit the screen so only show me one row. 但是看起来该表没有任何数据,并且当异步过程完成时,该表已填充但没有调整大小以适合屏幕,因此只显示一行。

The problem is with the Grid, I am not getting any scrollbars. 问题出在网格上,我没有任何滚动条。 Secondly I don't want to define the height and width of the Grid. 其次,我不想定义网格的高度和宽度。 I want it to take as much as possible and show scrollbars, just like we do in html table by setting width and height as 100%. 我希望它尽可能多地显示滚动条,就像我们在html表中通过将宽度和高度设置为100%一样。

Thanks 谢谢

I have found the solution. 我找到了解决方案。 I had to add the Grid on a panel. 我必须在面板上添加网格。 I had to set the layout of that panel to FitLayout(). 我必须将该面板的布局设置为FitLayout()。 Secondly had to call doLayout() on that panel after loading the Store with the data. 其次,在使用数据加载商店后,必须在该面板上调用doLayout()。 I now get the scrollbars for the table as well as it fits the whole available space. 现在,我得到了表格的滚动条,并且它适合整个可用空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM