【发布时间】:2021-06-02 11:52:00
【问题描述】:
我正在使用 GWT GridPanel。我希望其中一列可以换行,但我尝试过的没有任何效果。在关联的 css 文件中,我尝试过:
.x-grid3-cell-inner .x-grid3-col-note {
overflow: visible; white-space: normal !important;
}
其中 note 是我要包装的列的名称。没用。 我试过了:
.x-grid3-cell {
white-space:wrap;
}
没用。我试过了:
.x-grid3-cell-inner {
cell-wrap: true;
}
没用。任何人都有一个简单可行的解决方案?
编辑:我也尝试像这样在 ColumnConfig 中设置 id:
ColumnConfig[] columns = new ColumnConfig[] {
new ColumnConfig("Note", "note", 130, true, null, "note"),
new ColumnConfig("Date", "date", 65, true)
};
ColumnConfig c = columns[0];
c.setId("noteColumn");
然后在我添加的css中:
#noteColumn {
overflow: visible; white-space: normal !important;
}
但这也没有用。
【问题讨论】:
-
这看起来不像 GWT 的内置网格样式 - 你能提供更多上下文吗?
-
创建 GWT 项目时,它会创建一个 css 模板文件 ProjectName.css。当我查看呈现的 html 时,我看到了目标表格单元格的上述类名。所以我在该文件中添加了 css 以尝试让它们换行。
标签: javascript java css gwt