gpt4 book ai didi

gridview - 如何在 GXT 中设置列​​宽的权重?

转载 作者:行者123 更新时间:2023-12-04 06:40:13 27 4
gpt4 key购买 nike

是否可以在 GXT 的网格上设置列的“权重”?如果是这样,如何?

根据 Grid 的 Javadocs:

'Grid can resize columns based on a "weight". As the width of the grid, or columns change, the "weight" is used to allocate the extra space, or the space needed to be reduced.'



根据文档,它说要设置 GridView.setAutoFill(true)启用此功能,但没有提及有关配置权重的任何内容。

最佳答案

您在创建 ColumnConfig 时定义它们

private List<ColumnConfig> getColumnConfigs() {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

ColumnConfig col1ColumnConfig = new ColumnConfig("col1", "Col1", 50);

ColumnConfig col2ColumnConfig = new ColumnConfig("col2", "Col2", 75);

configs.add(col1ColumnConfig );
configs.add(col2ColumnConfig );
return configs;
}

ColumnModel cm = new ColumnModel(getColumnConfigs());
worklistGrid = new Grid<BeanModel>(store, cm);
worklistGrid.setAutoExpandColumn("col1"); //autoexpand
final GridView view = new GridView();
view.setAutoFill(true);

关于gridview - 如何在 GXT 中设置列​​宽的权重?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4349579/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com