v
Not logged inv
SearchAsk a QuestionReport an IssueMake a SuggestionMy Questions and Issues
Issue Details
Find By ID

Make client methods operating with selection available within the editor's public client-side API

Issue Details

Log in to Track Changes or Edit
S31396
Suggestion
Andy Tr (DevExpress)
Yes
Processed
Implemented
.NET (ASP.NET)
ASPxHtmlEditor
v2010 vol 2.2
9/1/2010 1:26:33 PM
-> Created by DevExpress Team 12/8/2008 11:11:05 AM
<- Updated by DevExpress Team 12/9/2008 12:03:54 PM

This suggestion is based upon question ASPxHTMLEditor Documentation is not complete., which relates to customers' necessity for creating custom dialogs.

Thanks,
Andrew

<- Processed (Accepted - Release TBD) by DevExpress Team 12/31/2008 8:54:15 AM
<- Processed (Implemented) by DevExpress Team 1/12/2009 1:19:45 PM
<- Updated by DevExpress Team 1/15/2009 12:29:59 PM

The following client methods have been implemented:
- GetSelection
- SetSelection

See online example E1083 to learn more (note that this example might be unavailable until version v2008 vol.3 is released).

<- Processed (Planned) by DevExpress Team 1/28/2009 3:35:57 PM
<- Processed (Accepted - Release TBD) by DevExpress Team 1/20/2010 10:56:55 AM
<- Processed (Planned) by DevExpress Team 7/29/2010 9:19:25 AM
<- Updated by DevExpress Team 9/1/2010 1:01:05 PM
<- Processed (Implemented) by DevExpress Team 9/1/2010 1:04:29 PM

Implementation Details:

Starting with v2010 vol 2, the ASPxHtmlEditor provides a comprehensive API, allowing you to access and modify the currently selected content at the client side. To access the selection, use the editor's GetSelection client function, which returns an ASPxClientHtmlEditorSelection class instance. This class provides a number of methods that help you perform various tasks on the selection. The most important methods include:
- GetHtml and SetHtml. Use these methods to obtain the selection's HTML markup and replace it with yours.
- GetElements. Allows you to access the selection's HTML elements as XML DOM nodes. With nodes, you can filter the selection's content by node types or directly change node values (as an alternative to SetHtml).
- GetText. Allows you to get the selection's text.
- GetSelectedElement. Use this method to obtain the element that contains the selection (the common parent element for all the selected elements).

To preserve the selection when focus moves outside the editor (when working with the selection using controls other than ASPxHtmlEditor toolbar items), call the editor's RestoreSelection client method before the GetSelection function call.

Note that the selection API is available only in the Design View.

Thanks,
DevExpress ASP.NET Team

Log in to Track Changes or Edit

Peer-to-Peer Discussion in DevExpress Forums

No discussion on this article has been started yet.

Please login to start discussion.

v
v
Search
Searching Tips