简体   繁体   中英

Any “Grid Panel” with GXT?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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