Page 1 of 1

readonly object lookup with more than 20 items

Posted: 30 May 2013
by Mario
Hello Forum,

Can anyone help me to set a lookup field with more then 20 item readonly in script?

This does not work for me:

fd.field('Lookup').control().readonly(true);

Help is appreciated.

Kind regards,

Mario

Re: readonly object lookup with more than 20 items

Posted: 30 May 2013
by Dmitry Kozlov
Please, use the following script:

Code: Select all

fd.field('Lookup').control()._el().find('input').attr('disabled', 'disabled');
fd.field('Lookup').control()._el().find('img').hide()
To revert field into editable state use the following script:

Code: Select all

fd.field('Lookup').control()._el().find('input').removeAttr('disabled');
fd.field('Lookup').control()._el().find('img').show()