OnClientLoad does not fire when disabled

3 posts, 0 answers
  1. Christian
    Christian avatar
    64 posts
    Member since:
    Apr 2008

    Posted 22 Aug Link to this post

    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. Christian
    Christian avatar
    64 posts
    Member since:
    Apr 2008

    Posted 22 Aug Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vessy
    Admin
    Vessy avatar
    1383 posts

    Posted 25 Aug Link to this post

    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.
Back to Top