EditModes on focus or toolbar

8 posts, 2 answers
  1. Alex
    Alex avatar
    48 posts
    Member since:
    Jun 2011

    Posted 04 Feb 2013 Link to this post

      Is there anyone to either show the EditModes (Html and Design) on focus (like I have the toolbar currently set) or is there an option to include a control/button in the toolbar for switching modes?
  2. Answer
    Rumen
    Admin
    Rumen avatar
    14084 posts

    Posted 06 Feb 2013 Link to this post

    Hello,

    You can add custom toolbar buttons to the toolbar which will call the editor.set_mode() method to change the mode. You can use the OnClientModeChange event and the setState method to enable these buttons in HTML and Preview modes.

    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Alex
    Alex avatar
    48 posts
    Member since:
    Jun 2011

    Posted 06 Feb 2013 Link to this post

      Just what I needed!  Well almost.  :)  The button to take me to HTML mode form design worked great, very simple!  However, I'm not sure how to get back to Design mode now since the toolbar, naturally, disappears when the ToolbarMode is set to ShowOnFocus.  I was hoping that when I used set_mode() that it would show the tabs at the bottom for Design and HTML.  So, for now, if I use the HTML, I'm stuck in HTML mode.  Are you aware of any good workarounds?
  4. Rumen
    Admin
    Rumen avatar
    14084 posts

    Posted 08 Feb 2013 Link to this post

    Hello,

    You should implement it with the Default toolbar, because indeed the built-in behavior of the ShowOnFocus toolbar is to become hidden in HTML mode. Another approach is to place these buttons outside of the editor.


    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Alex
    Alex avatar
    48 posts
    Member since:
    Jun 2011

    Posted 08 Feb 2013 Link to this post

    Ahh, interesting idea putting the button outside.  I'll have to check into that.

    By "implemen[ting] it with the Default toolbar" do you simply mean not using ShowOnFocus?
  6. Answer
    Rumen
    Admin
    Rumen avatar
    14084 posts

    Posted 08 Feb 2013 Link to this post

    Hello,

    You have two options:
    - Use the ShowOnFocus toolbar and put the Design, Html and Preview buttons outside.
    - OR set the ToolBarMode property to Default and add custom buttons in it for this buttons

    All the best,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Alex
    Alex avatar
    48 posts
    Member since:
    Jun 2011

    Posted 08 Feb 2013 Link to this post

      Great, thanks for the help!

      I'm trying to conserve space on a page with multiple RadEditors so ShowOnFocus is idea for this situation.  I'll see if my design can support creating external controls for changing modes.  Perhaps in a future release it would be nice to all a second ShowOnFocus bar just for the purpose of switching modes that would be available in HTML or preview mode.  Thanks!

  8. Rumen
    Admin
    Rumen avatar
    14084 posts

    Posted 08 Feb 2013 Link to this post

    Hello,

    Thank you for your feature request. If we enable more buttons in HTML mode in the future, we will definitely enable the ShowOnFocus toolbar in HTML mode to show them.

    Greetings,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top