Rendering Custom Elements in the Editor

5 posts, 0 answers
  1. Guy
    Guy avatar
    49 posts
    Member since:
    Oct 2007

    Posted 06 Feb 2012 Link to this post

    We are currently rebuilding a module in one of our applications that takes a document template, replaces marked placeholders within the template with specific data , and then allows the user to download the file as a word document.

    The user would like to be able to edit these templates online, before they are rendered.  One key feature that we need to include is conditional blocks - certain sections of the template will only be rendered if the data in the system meets specific conditions.  We need to make these conditional blocks as user friendly to edit as possible.  

    What i have envisaged is creating a custom module for the RadEditor that can be used to select and insert conditional blocks, that the user can then edit to their liking.  It is important that the end user (who is non technical) can identify and understand these conditional sections easily and click on them to load them in the custom module editor.  

    I notice i can create custom content filters in javascript that can hook into the rendering of the designer/html view, which would seem appropriate for this kind of solution.

    The problem is that there is no documentation on the customFilter object - where can i find more info on how to use this?
  2. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 08 Feb 2012 Link to this post

    Guy:

    Documentation on Content Filters contains a section on Implementing a Custom Filter with code.

    The online demo: Editor / Custom Content Filters provides some code and insights.

    Hope this helps!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Guy
    Guy avatar
    49 posts
    Member since:
    Oct 2007

    Posted 08 Feb 2012 Link to this post

    Hi,

    What you have linked to is all that is available in the manual, and ive read through that already.

    There is no documentation for the API, which puts me at a dead end.

    Quite surprised that there is nothing documented.

    will raise a support ticket.
  5. Rumen
    Admin
    Rumen avatar
    12848 posts

    Posted 09 Feb 2012 Link to this post

    Hello,

    For your convenience I wrote comments for the different methods used by the custom and built-in modules of RadEditor for ASP.NET AJAX:

    • MyFilter.initializeBase(this) - the initialization function of the module.
    • set_isDom(boolean) - specifies whether the filter will work with DOM objects or String, e.g. the boolean paramether specifies whether the content parameter of the getHtmlContent(content) and getDesignContent(content) functions will return DOM objects or String. The filter uses in the Custom Content Filters demo is of type string and converts the lowercase letters to uppercase.
    • set_enabled(boolean) - enable or disable the module depending on the boolean parameter
    • set_name(string) - specifies the name of the module
    • set_description(string) - specifies a more detailed description for the module
    • getDesignContent(content) - called when the editor is moving from some other mode to DESIGN mode
    • getHtmlContent(content) - called when the editor is moving from some other state to HTML mode 

    We will add this information to the help.



    Regards,
    Rumen
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Guy
    Guy avatar
    49 posts
    Member since:
    Oct 2007

    Posted 09 Feb 2012 Link to this post

    Thanks Rumen
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017