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

using OnClientLoad method (window.open logic inside)

1 Answer 57 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
pr
Top achievements
Rank 1
pr asked on 16 Feb 2011, 07:54 PM
Hi,

I am using extensions\wpresources\RadEditorSharePoint\4.5.4.0__1f131a624888eeed .
In moss, I want implement popup new windows for Links inside rad editor, I want to mention custom width n height (  They may chage in next developemnt)

trial -1:
I tried to use window.open directly inside radwindow  bt it didn't worked out, this piece of code striping by itself.

trial -2

I gone through  yur foum and you are using OnclientLoad javascript method for window.open 

So I tried to implement it.  see below :

On page layout 
<script type="text/javascript">
function OnClientLoad(editor)
   {
       editor.attachEventHandler ("onclick", function (e)
       {
            var sel = editor.getSelectedElement(); ; //get the currently selected element
            var href = null;
            var ele = document.getElementById("popupwindow");
if (ele)
{
if (sel.tagName == "A")
{
 href = sel.href; //get the href value of the selected link
window.open(href, null, "height=500,width=500,status=no,toolbar=no,menubar=no,location=no");
return false;
}
            }
       });
    }
    </script>

For telerik:
<telerik:RadHtmlField id="pagecontent" FieldName="PublishingPageContent" runat="server" AllowSpecialTags="true" OnClientLoad="OnClientLoad"/>

URl link will be like this, in HTML mode rad-
<div id = "popupwindow">
<a href blah blah>
</div>
But I am getting an error :
An error occurred during the processing of . Type 'Telerik.SharePoint.FieldEditor.RadHtmlField' does not have a public property named 'OnClientLoad'.

Trial -3 :

In configfile.xml :  I added <property name="OnClientLoad">OnClientLoad</property> 
still I am getting error: -> does not have a public property named 'OnClientLoad'.

Any suggestions???  Is there any way i can implement these popup links with custom width n height inside rad editor?

1 Answer, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 17 Feb 2011, 12:06 PM
Hi pr,

You need to use the ASP.NET AJAX version of RadEditor for MOSS, which now is 5.8.6. What I suggest you to do is upgrade to it. You can download a fully functional trial and follow the next upgrade article: Upgrade Instructions from version 4.x to version 5.x.

Also review the following online help articles:
Set Properties Via Config File
Add/Remove tools from the toolbar
ExternalDialogsPath property


All the best,
Stanimir
the Telerik team
Tags
WebParts for SharePoint
Asked by
pr
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Share this question
or