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

Custom modules in js files

2 Answers 85 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jeffrey Sylvan
Top achievements
Rank 1
Jeffrey Sylvan asked on 18 Aug 2008, 08:40 PM
Is it still possible to include custom modules in JS files? 

I'm looking to add a custom module in its own JS file like the old version allowed. Is this still possible? Can anyone direct me to either documentation or a sample on this if it is?

I could only find examples where the custom modules were added to aspx pages directly. I looked at the example on the online demo  http://www.telerik.com/DEMOS/ASPNET/Prometheus/Editor/Examples/BuiltinCustomModules/DefaultCS.aspx and the documentation http://www.telerik.com/help/aspnet-ajax/creatingcustommodules.html but did not see any examples that used js files. (I didn't use the samples linked from documentation becuase they lead to the old version of the editor)

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 19 Aug 2008, 04:47 PM
Hi Jeffrey,

All you need to do is to copy / paste the javascript code in an external JS file and import the file with script tag under the RadEditor declaration:

<telerik:radeditor runat="server" ID="RadEditor1" Height="700px" >
    <Modules>
        <telerik:EditorModule Name="MyModule" Enabled="true" Visible="true" />
        <telerik:EditorModule Name="RadEditorStatistics" Enabled="true" Visible="true" />
    </Modules>
</telerik:radeditor>
       
<script type="text/javascript" src="SymbolCounter.js"></script>

For your convenience I have attached a sample running project here.



Kind regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeffrey Sylvan
Top achievements
Rank 1
answered on 19 Aug 2008, 07:58 PM
Thanks a bunch; it looks like I was just trying to include the file too soon on the page. I threw it in ScriptManager.RegisterClientscript so it only gets requested once and it still works fine.
Tags
Editor
Asked by
Jeffrey Sylvan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Jeffrey Sylvan
Top achievements
Rank 1
Share this question
or