This is a migrated thread and some comments may be shown as answers.

GetPreviewContent not available in Editor?

4 Answers 67 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Trent Grandey
Top achievements
Rank 1
Trent Grandey asked on 06 Apr 2010, 07:21 AM
I am working on implementing a custom filter for my editor. Has the GetPreviewContent call been removed? When I'm moving to Preview, it seems to be calling my GetDesignContent filter.

If it has been removed, is there a workaround so I can tell the difference between Design and Preview?

Thanks in advance,

Trent

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 06 Apr 2010, 07:37 AM
Hi Trent,

The GetPreviewContent mode is not offered by RadEditor for ASP.NET AJAX, because the IFRAME in Preview mode is the same as the IFRAME element used in Design mode.

In your scenario you can use the OnClientModeChange event which is fired when switching between the three view modes.

These KB articles could be helpful:
Applying external stylesheet to the content of RadEditor in Preview mode
and
Enabling Print button in Preview mode.


Sincerely yours,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Trent Grandey
Top achievements
Rank 1
answered on 06 Apr 2010, 01:22 PM
Rumen,

Thank you so much for your quick response. This will work beautifully for me.

Regards,

Trent
0
Trent Grandey
Top achievements
Rank 1
answered on 18 Apr 2010, 06:46 AM
Well I thought I was going to make progress...

When changing between modes, I need to make changes to the entire content of the editor. I need to do a search and replace on the content. This worked great with the filters, but there seems to be no filter call when changing the mode to Preview now. So I implemented the OnClientModeChange and using the get_mode I can now trigger correctly on each mode. The problem is that I can't figure out how to work with the entire text of the editor's content. I see that I can get the text with get_text, but I have no way to put it back in its entirety. There is no set_text. Obviously using set_html won't work here, as I need to work with the content in the HEAD as well as the BODY.

Am I missing a way to be able to update the entire content area from the client-side?

I hope I have made this clear. Please let me know if I haven't.

Thank you,

Trent
0
Rumen
Telerik team
answered on 19 Apr 2010, 03:16 PM
Hello Trent,

Can you please explain your scenario in more details?

Basically, the only difference between the Design and Preview modes is that in Preview mode we disable the contentarea css link tag. What do you want to achieve?

Please, note that the set_html method works with full HTML pages and you can paste such content using it:

editor.set_html("<html><<head>New HTML</head><body>dasas</body></html>");


Best regards,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Trent Grandey
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Trent Grandey
Top achievements
Rank 1
Share this question
or