Clean formatting on paste

5 posts, 0 answers
  1. Zen
    Zen avatar
    9 posts
    Member since:
    Jun 2012

    Posted 18 Nov 2015 Link to this post

     Is there a way to clean formatting when pasting the content of the clipboard (not from MS Word document) into the Kendo UI Reader?

    Basically, I want to accomplish the same thing as the clean formatting tool does.  

     

    Thanks!

    Zen

  2. Zen
    Zen avatar
    9 posts
    Member since:
    Jun 2012

    Posted 18 Nov 2015 in reply to Zen Link to this post

    I mean to say Kendo UI Editor. So the question should be:

    Is there a way to do clean formatting when pasting the content of the clipboard (not from MS Word document) into the Kendo UI Editor? 

    Basically, I want to accomplish the same thing as the clean formatting tool does.  

     

    Thanks!

     

    Zen

  3. Kendo UI is VS 2017 Ready
  4. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 20 Nov 2015 Link to this post

    Hi Zen,

    Customizations on the pasted content can be performed in the paste event of the Editor.

    http://docs.telerik.com/kendo-ui/api/javascript/ui/editor#events-paste

    You can either use string manipulation, or temporarily inject the pasted content in an invisible container and clean the formatting via DOM manipulation.

    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Zen
    Zen avatar
    9 posts
    Member since:
    Jun 2012

    Posted 23 Nov 2015 in reply to Dimo Link to this post

    Dimo, thank you very much for your prompt reply. 

     Is there a way though, to use the code behind the Clean Formatting tool, to clean the pasted content?

     

    Thanks!

    Zen

  6. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 24 Nov 2015 Link to this post

    Hello Zen,

    The "Clean formatting" tool works with the currently selected content in the Editor. From this point of view, the tool can be used for the pasted content only if the user selects what he have already pasted and clean it manually.

    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready