Modify Display Height of Read Only HTML Variable on Catalog Item

Shawn Dowler
Tera Guru

What is the recommended way to modify the height of the box of a read-only HTML variable on the Catalog Item form? I would like to avoid having to create tons of UI Macros just to add a single line of rich text in the middle of forms.

33 REPLIES 33

It seems to be this particular piece of code the is causing the issue in IE and Chrome.


$(g_form.getControl(myReadonlyHTMLVariable).id + '_readOnlyDiv').style.height = '20';


I don't know why this isn't working, but I have to ask why you want to do it this way rather than the nobody role method described above? It works across browsers and is a lot less likely to break in the future.


I didn't fully understand it and the code just seemed easer.   I got it to not thought the error by adding the following code before the line $(g_form.getControl(myReadonlyHTMLVariable).id + '_readOnlyDiv').style.height = '20';.


if (typeof myReadonlyHTMLVariable.style === "undefined"){


  }


Mark Stanger: For others' edification and to check my work, this is the script on the sys_user_role read ACL that I'm using. Is this similar to what yours looks like to allow the admin to set the nobody role?



if(current.name == 'admin' && !gs.hasRole('admin'))


  answer = false;


else if (current.name == 'maint' && !gs.hasRole('maint'))


      answer = false;


// Allow admin to add "nobody" role


else if (current.name == 'nobody' && !gs.hasRole('admin'))


  answer = false;


else


      answer = true;



I'm hoping that this helps others who come across this figure out all the pieces a little easier.


I don't see any reason for restricting access to the 'admin' or 'nobody' roles at all.   My row-level read ACL for the 'sys_user_role' table looks like this...



if ((current.name == 'maint') && !gs.hasRole('maint'))


      answer = false;


else


      answer = true;