This is a migrated thread and some comments may be shown as answers.
OnClientLoad does not fire when disabled
2 Answers 12 Views
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 22 Aug 2016, 06:23 AM

I can see that he OnClientLoad is not fired when Enabled="false" is set, if I change this to true its working like a charm, is this by design?

seems weird as the control should have a load event on the client either way, problem is i need to declare the editor as a variable to set the enabled state manually with JS.

 

var _editor;
 
function edtRotator_onClientLoad(editor, args) {
    _editor = editor;
}
 
$(".rotator-images").dblclick(function () {
    _editor.enableEditing(true);
     _editor.set_editable(true);
 });

 

 

 

2 Answers, 1 is accepted

Sort by
0
Christian
Top achievements
Rank 1
answered on 22 Aug 2016, 06:52 AM
PS, i know i could probably use $find statement to reference the clientid with Inline script tags but i prefer not to use inline JS but keeping all my JS in seperate files.
0
Vessy
Telerik team
answered on 25 Aug 2016, 06:23 AM
Hi Christian,

When the Editor's Enabled property is set to False its client-side object is not initialized, thus it is not possible to use any of the control's client-side functionality at this moment. The Enabled property of RadEditor is inherited from WebControl class, you can find more information on the matter here:
https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.enabled(v=vs.110).aspx

In case you only want to hide the Editor, until an image from a Rotator is clicked, I would advise that you hide it via CSS style instead.

Regards,
Vessy
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Asked by
Christian
Top achievements
Rank 1
Answers by
Christian
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or