Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
960
Setting many different editor fields Readonly
posted

Hello,

i am trying to set some input fields on my screen readonly. I was disappointed that the native HTML attribute readonly="true" did not work, but saw I could use

$(".selector").igEditor("option", "readOnly", true);

However, some fields are igTextEditor, some are igMaskEditor, some are igNumerixEditor. etc. These controls are created via my own CSS class, so I don't have 300 separate initializations - ie :

        $(".myTextClass').igTextEditor();

        $(".myNumClass').igNumericEditor();

However only some of these are read only, so I want to add another class designating that the field is readonly ie :

        $(".myReadOnlyClass").igEditor("option", "readOnly", true);

But when I do this I get :

    Uncaught Error: cannot call methods on igEditor prior to initialization; attempted to call method 'option'

I presume this is because the fields were created as igTextEditor, igNumericEditor, etc and not igEditor. I thought igEditor would be like a 'superclass' meaning that its methods could be called on any subclass object.

Is there any 'generic' ig control name or function/method I can call on every ig control, no matter what the actual type of control it is?

Thank you