Editor - Generate Unique Id for sub elements

2 posts, 0 answers
  1. Mohammad
    Mohammad avatar
    1 posts
    Member since:
    Mar 2015

    Posted 05 Apr 2015 Link to this post

    Hi,

    I'm trying to generate a unique Id for each sub element within an inline editor using the change event on the editor:

     

    change: function () {

        $(editor).children().each(function (index, element) {
               $(this).uniqueId();
         });
    }

     

    This works well, except that I noticed that when I insert a new paragraph, the Kendo editor clones the previous paragraph including the id attribute, which results in duplicate Ids!

     Is there a way to override the cloning behavior in the editor? Intercept it to remove the id attribute from the newly inserted node?

     

    Thanks,

    Mohammad

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 08 Apr 2015 Link to this post

    Hello,

    Currently there is no way to intercept the cloning behavior and override it. You will have to adapt your code to override existing id attributes so they remain unique.

    Regards,
    Atanas Korchev
    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
Back to Top