Flex:RichTextEditor — 获取和设置 RICH 文本?
给定一个富文本编辑器,我想将“富”文本保存到数据库中,并稍后加载。
那么如何获取
和设置
富文本呢?
我查看了 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定富文本是什么意思。
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 theRichTextEditor
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 :)