Table formatting is gone in copy/paste from MS Word to Kendo Editor

8 posts, 0 answers
  1. Coolasia
    Coolasia avatar
    15 posts
    Member since:
    Apr 2014

    Posted 17 Mar Link to this post

    I have a problem in copy/paste from MS word to Kendo Editor.
    Copying only text is working fine. But when table is copied and pasted, all formatting is gone.
    How can I solve this problem?
  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 18 Mar Link to this post

    Hi Coolasia,

    I tried to reproduce the same with this online demo (http://demos.telerik.com/kendo-ui/editor/index), but to no avail.

    On my end, when a table is copied from Word, the table and the text formatting is properly pasted.

    On a side note, Kendo Editor does not implement functionality that somehow captures the pasted content and modify it. The data transferred through the clipboard is entirely depend on the browser and Kendo Editor cannot affect it so to somehow break the result.  

    Regards,
    Ianko
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Coolasia
    Coolasia avatar
    15 posts
    Member since:
    Apr 2014

    Posted 18 Mar in reply to Ianko Link to this post

    Hi Lanko,

    I have tried the demo in chrome, firefox and also IE where I am not able to get the formatted pasted in editor.

    From your side which browser did you test that you are able to copy the formatting to the editor?

    Thanks,

    Coolasia

  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 18 Mar Link to this post

    Hello Coolasia,

    I tested with Firefox on my end. You can see the results of the test in this screencast—http://screencast.com/t/I7y0ej8OBl.

    Also, as mentioned, the actual result entirely depends on the browser used. So any content pasted might be different in terms of HTML in different browser. That said, I would to again inform that Kendo Editor does not handle the paste event and it does not affect somehow the content to be pasted. 

    Regards,
    Ianko
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Coolasia
    Coolasia avatar
    15 posts
    Member since:
    Apr 2014

    Posted 20 Mar in reply to Ianko Link to this post

    Hello lanko,

    In the screencast which you sent I see that the text formatting is copied but if you see the table border is gone.

    My question is about the table formatting, why the formatting is not getting copied, is this also due to browser compatibility?

    Thanks,

    CoolAsia

  7. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 22 Mar Link to this post

    Hi CoolAsia,

    Thank you for pointing me what to look for. 

    I contacting the dev team about that. It appears that while pasting a table from MS Word, the content that the browser adds is invalid due to specific Word-related styles and values. This is why there is a feature implemented to clear almost all table formatting when pasting. 

    In order to disable this feature you can follow the approach from this forum post—http://www.telerik.com/forums/copy-text-from-office-to-editor#FLGvPlFypkCy3MUT76wYwQ.

    Regards,
    Ianko
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  8. Coolasia
    Coolasia avatar
    15 posts
    Member since:
    Apr 2014

    Posted 23 Mar in reply to Ianko Link to this post

    Hello lanko,

    I have followed the step given the post but still the table is getting pasted without formatting.

    I am calling the below script after the editor initialization.

    var editor = $("[data-role=editor]").data("kendoEditor");
    $(editor.body).off("paste");

    but still not able to paste the table with formatting.

    Can you send me some demo link for the above implementation.

    Thanks,

    CoolAsia

  9. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 25 Mar Link to this post

    Hi CoolAsia,

    Here you are a Dojo that shows the code in a runnable sample—http://dojo.telerik.com/IqUbI.

    Regards,
    Ianko
    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