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

3 posts, 0 answers
  1. Alexey Shkuro
    Alexey Shkuro avatar
    3 posts
    Member since:
    Dec 2009

    Posted 03 Aug 2014 Link to this post

    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. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 04 Aug 2014 Link to this post

    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.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Alexey Shkuro
    Alexey Shkuro avatar
    3 posts
    Member since:
    Dec 2009

    Posted 04 Aug 2014 in reply to Alex Gyoshev Link to this post

    Hello.

    Thanks for the reply.

    Regards,
    Alexey
Back to Top