This is a migrated thread and some comments may be shown as answers.

Editor - Generate Unique Id for sub elements

1 Answer 198 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mohammad
Top achievements
Rank 1
Mohammad asked on 05 Apr 2015, 03:14 PM

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

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 08 Apr 2015, 05:50 AM
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!
 
Tags
Editor
Asked by
Mohammad
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or