Editing source

Thread is closed for posting
18 posts, 0 answers
  1. Jesse
    Jesse avatar
    12 posts
    Member since:
    Jul 2012

    Posted 27 Jun 2012 Link to this post

    I'm wanting to changed the default behavior of when you hit enter and it double space to be single spacing when you hit Shift + Enter, but I cannot find out where Shift + Enter is being performed in the source. Also under JavaScript Dependencies there is no list of the required JavaScript files for the editor. Thanks
  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2592 posts

    Posted 02 Jul 2012 Link to this post

    Hi Jesse,

    I have already replied to your support ticket on the same subject. For convenience I am pasting my reply here too, so the other users who experience the same issue can read it: 

    In order to achieve the desired behavior you could use the following code snippet:  

    var editorNS = kendo.ui.editor,
    registerTool = editorNS.EditorUtils.registerTool,
    Tool = editorNS.Tool;
    registerTool("insertLineBreak", new Tool({ key: 13, command: editorNS.NewLineCommand }));
    registerTool("insertParagraph", new Tool({ key: 13, shift: true, command: editorNS.ParagraphCommand }));

    Regarding the JavaScript files for the editor in the JavaScript Dependencies section from the documentation - indeed this is an overlook from our side. We have updated this topic from the documentation and the change is already available. As a sign of gratitude I updated your points. 
     

    Regards,
    Iliana Nikolova
    the Telerik team
    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. adam
    adam avatar
    20 posts
    Member since:
    Dec 2007

    Posted 20 Jul 2012 Link to this post

    Iliana,
    Thank you for your example. This seems to globally affect all editors on the page. Do you have an example where we can make this change isolated to a specific editor?

    I found a related post, but it is for the MVC Extensions (http://www.telerik.com/community/code-library/aspnet-mvc/editor/how-to-insert-a-new-line-on-enter-instead-of-a-new-paragraph.aspx). I haven't been able to get it to work.
  5. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2592 posts

    Posted 24 Jul 2012 Link to this post

    Hi Adam,

    I prepared a small example which illustrates how to make this change only to a specific editor - please find it attached.
     
    Greetings,
    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Christopher Chenoweth
    Christopher Chenoweth avatar
    4 posts
    Member since:
    Nov 2008

    Posted 09 Oct 2012 Link to this post

    $("#TextArea1").kendoEditor({
        tools: [
      { name: "insertLineBreak", shift: false },
        { name: "insertParagraph", shift: true }
        ],
          
    });

    The above example is far easier to me and works like a charm.  
  7. Don
    Don avatar
    13 posts
    Member since:
    Apr 2012

    Posted 11 Feb 2013 Link to this post

    Is there a way to do this without loosing all the other tools?  If I do the code as shown in previous post (adding a tools node when setting up the editor), the tools string ONLY has these two options.  All other tools are removed.  I dont want to have to add each tool I need to the list, but instead modify the setting for only two of its values.


    I was able to fix this by doing the followiing:

    $( this ).data( 'kendoEditor' ).tools.insertLineBreak.options.shift = false;
    $( this ).data( 'kendoEditor' ).tools.insertParagraph.options.shift = true;

    Is there a "cleaner" way to do this?
  8. Peter
    Peter avatar
    1 posts
    Member since:
    Mar 2013

    Posted 14 Mar 2013 Link to this post

    Hello,
    I face the same problem. I want to add <br \> when hitting enter.
    How can I change the default behavior in he MVC configuration?

    Thank you
  9. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2592 posts

    Posted 19 Mar 2013 Link to this post

    Hello Peter,

    I have already answered to your support ticket with the same questions, however I am pasting my reply here too: 

    In order to achieve this in Kendo UI Editor for ASP.NET MVC you can use the same approach as in Kendo UI Web Editor. 

    Also, I am attaching a sample project which demonstrates the desired functionality in action.

    Regards,

    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  10. Simon
    Simon avatar
    2 posts
    Member since:
    Mar 2013

    Posted 19 Mar 2013 Link to this post

    Hello Iliana,
    I have the same problem. Thank you for providing the source code here. However, when I run the test code I receive following JavaScript exception in Visual Studio:

    Unhandled exception at line 18, column 11929 in http://localhost:30060/Scripts/kendo/2012.3.1114/kendo.all.min.js

    0x800a138f - JavaScript runtime error: Unable to get property 'ownerDocument' of undefined or null reference

    I am using IE 9.

    Have you any idea how to fix this?
  11. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2592 posts

    Posted 25 Mar 2013 Link to this post

    Hi Simon,

    I am not quite sure what causes the problem on your side - I tested the example in IE 9 and everything works correctly. Could you please check this short screencast capture and let me know if I missed something? Thank you in advance for your cooperation. 

    Regards,
    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  12. Simon
    Simon avatar
    2 posts
    Member since:
    Mar 2013

    Posted 02 Apr 2013 Link to this post

    Hi Iliana,

    sorry for my late reply. This is really strange. I am using IE 10 and Visual Studio 2012 and the exception (as shown in my previous picture) is thrown. Maybe this has something to do with Visual Studio 2012?
    However, the code/ function works.

    Best regards
  13. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2592 posts

    Posted 05 Apr 2013 Link to this post

    Hello Simon,

    I discussed the case with my colleagues and it appears there was an issue in the editor, however the developers addressed it and the fix will be included in our next internal build. Please excuse us for the inconvenience caused.

    Regards,
    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  14. Dean Wise
    Dean Wise avatar
    5 posts
    Member since:
    Jan 2013

    Posted 26 Apr 2013 Link to this post

    Iliana, 
        I'm having the same issue as Simon in IE 9. Is this fix available yet? If so, how can I acqure it?

    Thanks,
    Dean Wise
  15. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2592 posts

    Posted 01 May 2013 Link to this post

    Hello Dean,

    I am glad to inform you the fix is already available and it is included in our latest internal build, which you can download from your account (you have to be logged in). Please test your application using the aforementioned build and let me know if you still observe any problems. 

    Regards,
    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  16. Ben
    Ben avatar
    4 posts
    Member since:
    Dec 2012

    Posted 01 May 2013 Link to this post

    This works great on desktops but not on iPads. It's almost as if the editor isn't detecting the shift event. Regardless of whether you press shift or not, a line break is inserted.
  17. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 02 May 2013 Link to this post

    Hello Ben,

    Sadly, we cannot address this problem. The shift key is not reported by iOS. See this SO thread for more details.

    Regards,
    Alex Gyoshev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  18. Craig
    Craig avatar
    35 posts
    Member since:
    Feb 2012

    Posted 02 Jul 2013 Link to this post

    i would also like to know more information on this topic.
    I am initializing my editor with knockout-kendo bindings, so I need to pass my options in the data-bind statement.
    When I try to use these options all the tool bars disappear.  I realize that knockout-kendo isn't a product of Telerik but the binding statements are just independent proxy objects of the underlying Kendo library.

    Eeek!

    <div data-bind="kendoEditor: { value: PrimaryIAMLReconciliation, tools: [ { name: 'insertLineBreak', shift: false }, { name: 'insertParagraph', shift: true } ] }"></div>
    is basically the equivalent of:

    $("#TextArea1").kendoEditor({
         tools: [
              { name: "insertLineBreak", shift: false },
              { name: "insertParagraph", shift: true }
         ]
    });
  19. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 08 Jul 2013 Link to this post

    Hello Craig,

    To achieve this, use the documented approach through the defaultTools array.

    Regards,
    Alex Gyoshev
    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