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

Editor does not allow you to use the JQuery function "find".

2 Answers 55 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alexey Shkuro
Top achievements
Rank 1
Alexey Shkuro asked on 03 Aug 2014, 03:36 PM
Hello.

Now use the insert controls in the content editor.
I need to search for items on the "class" attribute using jquery function "find()".
As a container for search uses the <div> editor.
However, the function "find()" returns an empty set of elements, although the elements are within the editor.
Tell me how you can solve the problem?

Thank you.
Regards,
Alexey.

2 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 04 Aug 2014, 11:17 AM
Hello Alexey,

By default, the editor renders its contents within an iframe sandbox, so if you need to have access to them, you need to query them through its body element, like this:

    var editor = $("[data-role=editor]").data("kendoEditor");
    var paragraphs = $(editor.body).find("p"); // find all <p>aragraphs in the body

Regards,
Alex Gyoshev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Alexey Shkuro
Top achievements
Rank 1
answered on 04 Aug 2014, 03:14 PM
Hello.

Thanks for the reply.

Regards,
Alexey
Tags
Editor
Asked by
Alexey Shkuro
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Alexey Shkuro
Top achievements
Rank 1
Share this question
or