Okay, something changed in the most recent version. We used to be able to use the advanced editor as follows.
Okay instead of putting 10000 lines of code i took pieces out to show what we are doing and was working.
We declare a RadWindow at the beginning of code (line 150) - "RadWindowAdvEditor"
We set code for the Editor before the Grid (which worked (line 208) - moving after the grid didnt matter (line 1472)) - "RadScriptBlockEditor"
We have 2 Grids, 1 Grid holds a master record (line 259) and when in edit mode it shows another Grid (line 466) which hold sub items of the master record. So you edit one of the sub items from the sub grid and it shows 3 editors and lots of other stuff. All in a EditFormSettings->FormTemplate of the sub grid.
The user, before the update Q1 2014, was able to click on the RichEditor icon and open up the RadWindow to edit and it sent back the content and updated the RadEditor embedded in the EditForm correctly. This worked for years, we were on a 2013 version. You can see from the last code snippet that the RadEditors are indeed embedded in 2 grids.
Now we tried to change it around, put the script at the end. We cant put it after the RadEditor object declare due to it being in a Edit form. The reason is all of a sudden the clients are getting the dreaded "The command RichEditor is not implemented yet."
We have other forms w/o the Grids and Edit Forms - just laying on a WebForm and it works fine. The code is BEFORE the declaration of the RadEditor and we dont have a problem.
Please advise! We have clients who can not use the advanced editor for the their registration emails that we provide for them.
Thanks Telerik!
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"MainContent"
runat
=
"server"
>
<%-- register the RadWindow for the Advanced Editing --%>
<
telerik:RadWindow
runat
=
"server"
ID
=
"RadWindowAdvEditor"
NavigateUrl
=
"~/RegisterPro/radeditorwindow.aspx"
EnableEmbeddedBaseStylesheet
=
"true"
VisibleTitlebar
=
"true"
OnClientShow
=
"SetDialogContent"
OnClientPageLoad
=
"SetDialogContent"
Behaviors
=
"Maximize,Close,Move"
Width
=
"800px"
Modal
=
"true"
Height
=
"700px"
/>
<
fieldset
id
=
"FieldSetMain"
class
=
"ui-widget ui-widget-content ui-corner-all"
style
=
"padding: 10px; width: 960px;"
>
<
legend
id
=
"LegendEventManager"
class
=
"ui-widget-header ui-corner-all"
> Events Manager </
legend
>
<%-- Grid for add/edit/delete events (master and sub) --%>
<
div
style
=
"float: left;"
>
<%-- script for the RadWindow --%>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlockEditor"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
//![CDATA[
var myEditorContent = null;
var myMessageType = "CommandExecute?";
var myEditor;
jQuery(function () {
if (typeof (RadEditorCommandList) != "undefined") {
Telerik.Web.UI.Editor.CommandList["RichEditor"] = function (commandName, editor, args) {
myEditor = editor; // set editor object so we can use it from window return - SetEditorContent
myEditorContent = editor.get_html(true); //get RadEditor content
$find("<%= RadWindowAdvEditor.ClientID%>").show(); //open RadWindow
}
}
})
function SetEditorContent(content) {
//set content to RadEditor on the main page from RadWindow
myEditor.set_html(content);
}
function SetDialogContent(oWnd) {
var myContentWindow = oWnd.get_contentFrame().contentWindow;
if (myContentWindow && myContentWindow.setContent) {
window.setTimeout(function () {
//pass and set the content from the mane page to RadEditor in RadWindow
myContentWindow.setContent(myEditorContent);
}, 500);
}
}
<
telerik:RadGrid
runat
=
"server"
ID
=
"RadGridEventMaster"
Height
=
"100%"
Width
=
"97%"
AllowMultiRowSelection
=
"false"
AutoGenerateColumns
=
"True"
ShowHeader
=
"False"
AllowAutomaticUpdates
=
"false"
AllowAutomaticInserts
=
"false"
>
<
MasterTableView
CommandItemDisplay
=
"Top"
NoMasterRecordsText
=
"There are no events to display..."
DataKeyNames
=
"EventMasterId"
EditMode
=
"EditForms"
AllowAutomaticUpdates
=
"false"
AllowAutomaticInserts
=
"false"
>
<
CommandItemTemplate
>
<%-- Edit form master event template --%>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"RadGridEventSub"
Height
=
"100%"
Width
=
"100%"
AllowMultiRowSelection
=
"false"
AutoGenerateColumns
=
"false"
OnItemCommand
=
"RadGridEventSub_ItemCommand"
OnDeleteCommand
=
"RadGridEventSub_DeleteCommand"
OnInsertCommand
=
"RadGridEventSub_InsertCommand"
OnUpdateCommand
=
"RadGridEventSub_UpdateCommand"
OnNeedDataSource
=
"RadGridEventSub_NeedDataSource"
OnItemDataBound
=
"RadGridEventSub_ItemDataBound"
OnItemCreated
=
"RadGridEventSub_ItemCreated"
AllowAutomaticUpdates
=
"true"
AllowAutomaticInserts
=
"true"
>
<
MasterTableView
CommandItemDisplay
=
"Top"
NoMasterRecordsText
=
"There are no events to display..."
DataKeyNames
=
"EventMasterId, EventSubId, GroupId, Name, EventTypeId, BoardPositionId"
EditMode
=
"EditForms"
>
<
CommandItemSettings
AddNewRecordText
=
"Add a new sub event"
ShowRefreshButton
=
"false"
/>
<
div
>
<
telerik:RadEditor
runat
=
"server"
ID
=
"RadEditorEmailNotificationMsg"
ToolsWidth
=
"100%"
Height
=
"200px"
Width
=
"100%"
EnableResize
=
"false"
ContentAreaMode
=
"Div"
Content='<%# Eval("EmailNotificationMsg") %>'>
<
Tools
>
<
telerik:EditorToolGroup
>
<
telerik:EditorTool
Name
=
"RichEditor"
Text
=
"Open Advanced Editor"
/>
<
telerik:EditorTool
Name
=
"Bold"
/>
<
telerik:EditorTool
Name
=
"Italic"
/>
<
telerik:EditorTool
Name
=
"Underline"
/>
<
telerik:EditorTool
Name
=
"Cut"
/>
<
telerik:EditorTool
Name
=
"Copy"
/>
<
telerik:EditorTool
Name
=
"Paste"
/>
<
telerik:EditorTool
Name
=
"FontName"
/>
<
telerik:EditorTool
Name
=
"RealFontSize"
/>
</
telerik:EditorToolGroup
>
</
Tools
>
</
telerik:RadEditor
>
</
div
>
</
div
>
</
FormTemplate
>
</
EditFormSettings
>
<%-- Edit form template --%>
</
MasterTableView
>
</
telerik:RadGrid
>
</
div
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
Okay instead of putting 10000 lines of code i took pieces out to show what we are doing and was working.
We declare a RadWindow at the beginning of code (line 150) - "RadWindowAdvEditor"
We set code for the Editor before the Grid (which worked (line 208) - moving after the grid didnt matter (line 1472)) - "RadScriptBlockEditor"
We have 2 Grids, 1 Grid holds a master record (line 259) and when in edit mode it shows another Grid (line 466) which hold sub items of the master record. So you edit one of the sub items from the sub grid and it shows 3 editors and lots of other stuff. All in a EditFormSettings->FormTemplate of the sub grid.
The user, before the update Q1 2014, was able to click on the RichEditor icon and open up the RadWindow to edit and it sent back the content and updated the RadEditor embedded in the EditForm correctly. This worked for years, we were on a 2013 version. You can see from the last code snippet that the RadEditors are indeed embedded in 2 grids.
Now we tried to change it around, put the script at the end. We cant put it after the RadEditor object declare due to it being in a Edit form. The reason is all of a sudden the clients are getting the dreaded "The command RichEditor is not implemented yet."
We have other forms w/o the Grids and Edit Forms - just laying on a WebForm and it works fine. The code is BEFORE the declaration of the RadEditor and we dont have a problem.
Please advise! We have clients who can not use the advanced editor for the their registration emails that we provide for them.
Thanks Telerik!