任何“网格面板”与GXT?

发布于 2025-01-06 08:45:00 字数 231 浏览 0 评论 0原文

我对 GXT 还很陌生。是否有类似于带有 GXT 的 GWT 原生 FlexTable 的小部件? 可以以网格方式显示小部件的东西,由 setWidget(int row, int col) 之类的东西设置?

我尝试在 LayoutContainer 中插入 FlexTable,但它无法正确呈现。我的要求不像带有数据的表格网格,而是很像一个以网格方式显示小部件的“网格面板”。

I'm quite new to GXT. Is there a widget that is similar to a GWT native FlexTable with GXT?
Something that can display a widget in a grid fashion, set by something like setWidget(int row, int col) ?

I tried inserting a FlexTable in a LayoutContainer however it does not render properly. My requirement is not like a table grid with data, but much like a "grid panel" that will display widgets in a grid way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梅窗月明清似水 2025-01-13 08:45:01

我可能会将您的“棋盘”与电子表格进行比较 - 行/列没有特定的含义/数据/宽度/标题,对称性和灵活性才是重要的。相比之下,GXT 的 Grid(以及 GWT 的 CellTable、DataTable)设计得更像数据库,其中每一列都有特定的含义,并且列数几乎总是固定(但有些灵活),但行数可以增长。

我会研究 GWT 自己的 FlexTable 或 Grid。如果它不能与 GXT 2 的 LayoutContainer 一起正常工作,请确保在将 LayoutContainer 添加到父级之前添加它,或者在添加它之后调用 layout() 以确保它被绘制。

使用小部件绘制棋盘样式网格意味着您正在绘制大量小部件,这不会非常快/高效。如果您实际上不需要小部件,但单元格就足够了,我会考虑制作一个单元格小部件,它可以反复绘制多个行/列的相同单元格,但包含每个位置所需的特定数据。

如果您的代码几乎可以工作,那么允许将其发布,也许可以讨论您正在做什么,以及如何以不同的方式完成它。

I might compare your 'chessboard' with a spreadsheet - the rows/columns dont have particular meaning/data/widths/headers, symmetry and flexibility is what is important. In contrast, GXT's Grid (and GWT's CellTable, DataTable) is designed more like a database, where each column has particular meaning, and almost always a fixed (but somewhat flexible) number of columns, but the row count can grow.

I'd look into GWT's own FlexTable or Grid. If it doesn't work correctly with GXT 2's LayoutContainer, make sure you either add it before the LayoutContainer is added to a parent, or call layout() after adding it to be sure it is drawn.

Drawing a chessboard style grid with widgets means you are drawing a lot of widgets, which isn't going to be terribly fast/efficient. If you don't actually need widgets, but cells will suffice, I'd look into making a cell widget that draws the same cell over and over for a number of rows/columns, but with the specific data you need for each position.

If you have code that almost works, SO allows that to be posted, to perhaps discuss what you are doing, and how it might be done differently.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文