Flex:RichTextEditor — 获取和设置 RICH 文本?

发布于 2024-08-22 05:52:56 字数 451 浏览 2 评论 0原文

给定一个富文本编辑器,我想将“富”文本保存到数据库中,并稍后加载。

那么如何获取设置富文本呢?

我查看了 API,有一个名为 text 的属性,它只是纯文本,不是我需要的。还有另一个名为 textSnapshot 的属性,听起来也许这就是我需要使用的属性,但它是只读的,所以我无法设置它?

有办法做到这一点吗?

谢谢!

更新事实

证明我只会从 RichTextEditor 保存它,并且我需要在 Text 控件上设置它具有 htmlText

所以有没有办法获取富文本并将其转换为hmtlText

Given a rich text editor, I want to save the "rich" text to a database, and load it later.

So how can I get and set the rich text?

I looked at the API and there is a property called text which is only PLAIN text, not what I need. There is another property called textSnapshot which sounds like maybe thats what I need to use, but its READ-ONLY so I can't set it?

Is there a way to do this?

Thanks!

UPDATE

It turns out I am only going to save it from a RichTextEditor, and I need to set it has htmlText on a Text control,

so is there a way to get the rich text and convert it to hmtlText?

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

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

发布评论

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

评论(1

泛泛之交 2024-08-29 05:52:56

我不确定富文本是什么意思。 htmlText 保存组件用于渲染 HTML 文本的所有信息,也是 RichTextEditor 渲染的基础。您可以获取并设置它,这正是您需要存储在数据库中并在检索后将文本放回的内容。无法将其导出为 rtf 组件。它丰富,因为它不仅仅是一个简单的文本输入:)

I'm not sure what you mean by rich text. The htmlText holds all the informations which the components use for rendering the HTML text, and which is also the base of the RichTextEditor rendering. You can get and set it, and that's exactly what you need to store in the DB and put the text back after retrieving it. There's no export it as rtf out of the component. It's rich in the sense that it's more than a simple textInput :)

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