ExtJS:如何用列将文本包装在ListView中?

发布于 2024-09-17 09:02:04 字数 237 浏览 5 评论 0原文

我有一个包含 4 列的 ExtJS ListView 控件。其中一列包含延伸列宽度的文本,因此某些文本位于下一列的下方。

Example image

如何将 white-space 设置为 normal列表视图中的单元格?

I have an ExtJS ListView control with 4 columns. One of the columns contain text which extends the width of the column, thus some of the text are located beneath the next column.

Example image

How can I set white-space to normal for the cells in the listview?

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

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

发布评论

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

评论(3

又爬满兰若 2024-09-24 09:02:04

这应该在您的列定义中:

{
    header: 'Besked',
    dataIndex: 'besked',
    tpl: '<p style=\"white-space:normal\";>{besked}</p>'
}

This should be in your column definition:

{
    header: 'Besked',
    dataIndex: 'besked',
    tpl: '<p style=\"white-space:normal\";>{besked}</p>'
}
煮茶煮酒煮时光 2024-09-24 09:02:04

Sdavids 解决方案有效并且我对此投了赞成票。

但以防万一您更喜欢使用 css 类而不是样式,方法如下:

{
    header: 'Besked',
    dataIndex: 'besked',
    cls: 'listViewColumnWrap'
}

然后您需要在某个 css 文件中添加这一行:

.listViewColumnWrap { white-space:normal; }

Sdavids solution works and I voted for that.

But just in case you prefer using a css class instead of styles this is how:

{
    header: 'Besked',
    dataIndex: 'besked',
    cls: 'listViewColumnWrap'
}

Then you need this line in some css file:

.listViewColumnWrap { white-space:normal; }
等风来 2024-09-24 09:02:04

这是一种覆盖默认 css 类的跨浏览器方法,以使所有列表视图、网格和组合框选择菜单都包裹其文本内容:

.x-list-body dt {white-space: normal;}
.x-list-body dt em { white-space: pre-wrap !important; word-wrap: break-word !important;}
.x-grid3-row-flag { white-space: normal; background-color: #ffc; }
.x-grid3-cell-inner, .x-grid3-hd-inner{ white-space: normal; }
.x-grid3-cell-inner { white-space: pre-wrap !important; word-wrap: break-word !important;}
.x-combo-list-inner .x-combo-list-item { white-space: normal; }
.x-combo-list-item { white-space: pre-wrap !important; word-wrap: break-word !important;}

This is a cross-browser way to override the default css classes to make all of your list views, grids, and combobox select menus all wrap their text content:

.x-list-body dt {white-space: normal;}
.x-list-body dt em { white-space: pre-wrap !important; word-wrap: break-word !important;}
.x-grid3-row-flag { white-space: normal; background-color: #ffc; }
.x-grid3-cell-inner, .x-grid3-hd-inner{ white-space: normal; }
.x-grid3-cell-inner { white-space: pre-wrap !important; word-wrap: break-word !important;}
.x-combo-list-inner .x-combo-list-item { white-space: normal; }
.x-combo-list-item { white-space: pre-wrap !important; word-wrap: break-word !important;}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文