in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Custom toolbar button to add float.

Last post 9/10/2008 2:42 AM by Andrew R (Developer Express). 1 replies.
Page 1 of 1 (2 items)
Sort Posts:
Previous Next
  • 9/9/2008 5:10 PM

    • Liz R
    • Not Ranked
    • Joined on 9/9/2008
    • Posts 1

    Custom toolbar button to add float.

     I created a custom button that will add a div with a style float, but I want it to appear around the selected text. How do I do this?

     So far in my script I have this...

    <script type="text/javascript">
        function ProTools(commandName) {
        switch(commandName) {
           case('FloatRight'):
                var htmlEdit = HtmlEditor.GetHtml();
                HtmlEditor.ExecuteCommand(ASPxClientCommandConsts.PASTEHTML_COMMAND, '<div style="float: right;">' + htmlEdit + '</div>');
               
                break;
        }
    }
    </script>

    But it takes the entire html that is in the editor. How do I get just what is highlighted.

  • 9/10/2008 2:42 AM In reply to

    Re: Custom toolbar button to add float.

    Hi!

    Currently, it's impossible to get the selected text in ASPxHtmlEditor. We have "Add ClientAPI for working with Selection in ASPxHtmlEditor" suggestion, you can track the status of this issue here:
    www.devexpress.com/issue=S91826

    Thanks,
    Andrew R

    R&D, ASP.Net Team
    Developer Express Inc.

    PS. If you wish to receive direct assistance from our Support Team, use Support Center at http://www.devexpress.com/Support/Center
Page 1 of 1 (2 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED