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

Editor is disabled when AJAX loaded

3 Answers 62 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Khoa
Top achievements
Rank 1
Khoa asked on 17 Feb 2011, 11:01 PM
I have a TabStrip that uses LoadContentFrom to load a partial view that contains an Editor control.  However, the Editor control appears but is disabled - meaning I can't type in the textarea or use any of the toolbar buttons. 

When I don't use the TabStrip and just load the view with the Editor on it's own, the Editor is working correctly.

Has anyone else experienced this behavior?

3 Answers, 1 is accepted

Sort by
0
Khoa
Top achievements
Rank 1
answered on 17 Feb 2011, 11:25 PM
Since this is a partial view loaded using AJAX I have to manually register the javascript files required.  That fixed my issue.
0
Emily Hatch
Top achievements
Rank 1
answered on 09 Mar 2011, 07:42 PM
Khoa - I have a similar problem and I have tried registering the js files manually with no joy.  Would you mind providing a code snippet as an example?  Thanks!
0
Khoa
Top achievements
Rank 1
answered on 09 Mar 2011, 07:59 PM
In my main view, I register the javascript files:

@(Html.Telerik().ScriptRegistrar().Globalization(

 

true).DefaultGroup(editorgroup => editorgroup.Add("jquery-1.4.4.min.js")

 

 

.Add(

 

"telerik.common.min.js")

 

 

.Add(

 

"telerik.list.min.js")

 

 

.Add(

 

"telerik.combobox.min.js")

 

 

.Add(

 

"telerik.draganddrop.min.js")

 

 

.Add(

 

"telerik.window.min.js")

 

 

.Add(

 

"telerik.editor.min.js")

 

.Combined(

 

true).Compress(true)))

 



Also, in the main view the TabStrip is added:

@(Html.Telerik().TabStrip()

.Name(

 

"DeliveryTab")

 

 

.Items(menu =>

 

{

 

menu.Add().Text(

 

"E-mail")

 

 

.Action(

 

"Email", "Messages")

 

 

.Selected(ViewBag.CurrentDeliveryTab ==

 

"Email" ? true: false)

 

 

.LoadContentFrom(Url.Action(

 

"Email", "Messages"));

 

 

 

})

)



In my Email partial view I add the Editor like this:

@{

Html.Telerik()

.Editor()

.Name(

 

"EmailScript")

 

 

.HtmlAttributes(

 

new { style = "height:400px" })

 

 

.Value(Model.MessageBody)

 

.Render();

 

}

Hope this helps!

Tags
Editor
Asked by
Khoa
Top achievements
Rank 1
Answers by
Khoa
Top achievements
Rank 1
Emily Hatch
Top achievements
Rank 1
Share this question
or