Flex DataGridColumn 显示多行字符串数据

发布于 2024-08-02 09:31:56 字数 296 浏览 3 评论 0原文

是否可以在 Flex DataGridColumn 中显示多行字符串?

即显示:

文本第一行。

文本第二行。

我尝试在存储字符串时放置“\n”、“\r”、“
”,但似乎没有任何效果。

目前只有“文本第一行”。显示,其余部分隐藏在单元格中。我不想使用“wordWrap=true”来模拟单元格中的这种行为,而是能够手动插入换行符(尽管我可以打开 wordWrap 以避免长文本由于单元格尺寸而隐藏)。感谢您的回复。

Is it possible to display a multiline string in a Flex DataGridColumn?

i.e. Display:

Text line one.

Text line two.

I've tried putting "\n","\r"," " when storing the string but nothing seems to work.

Currently only "Text line one." is displayed and the rest is hidden in the cell. I would prefer not to use "wordWrap=true" to emulate this behaviour in the cell, but instead be able to manually put in newline breaks (although I could turn on wordWrap to avoid long text from hiding due to cell dimensions). Thanks for any replies.

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

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

发布评论

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

评论(3

岁吢 2024-08-09 09:31:56

没关系。设置“wordWrap=true”和“variableRowHeight=true”似乎有效。

Never mind. Setting "wordWrap=true" and "variableRowHeight=true" seems to work.

灯下孤影 2024-08-09 09:31:56

我不知道你是否解决了你的问题,但其他人可能会得到帮助。

完美的解决方案是

  1. 设置 variableRowHeight = true;
  2. 设置 wordWrap = true;
  3. 对于数据网格列使用 itemEditor="mx.controls.TextArea";

谢谢,

斯瓦普尼尔。

I don't know whether you solve your problem or not but might other can get help.

The perfect solution is to

  1. Set variableRowHeight = true;
  2. Set wordWrap = true;
  3. For datagrid column use itemEditor="mx.controls.TextArea";

Thanks,

Swapnil.

○闲身 2024-08-09 09:31:56

您将需要创建 itemrenderer 并使用 mx:Text 组件。然后,您可以使用 " "、\n 或 \r 换行

you will need to create and itemrenderer and use the mx:Text component. You can then break to a new line using " ", \n, or \r

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