I don't want to apply styles to read-only fields

bonsai
Mega Sage

I edited the style of the field and gave it color.
However, I want the color to be gray if it is read-only as a requirement.

Styles now take precedence even if read-only.
Is there a way to reject a style if it is read-only?

8 REPLIES 8

Reference fields resolved! ! !
thank you!

Next is a list type field...

Hi @bonsai 

The list type field differs from a reference field as it encompasses various element parts within a field.

To be able to provide an accurate answer, I'd need more details on how you'd like to style it.

 

Cheers,

Tai Vu

I would like to have the same state as when applying a normal style record.

If I could use "g_scratchpad.variable" in the value field of the style record, everything would be solved, but since I can't do that, I wanted to use a client-side script.

test_list.JPGtest_list2.JPGtest_list_styl.JPG

Hi @bonsai 

Within the Style from your screenshot above, if your fields are managed read-only through ACLs, you may want to give this med a try.

canWrite()

Sample.

current.test_list.canWrite();

 

If you still want to come with the client script you can try this below. (Isolate script is unchecked)

var select = $('select_0<table_name>.<field_name>');
var lookup = $('sys_display.<table_name>.<field_name>');
var text = $('text.value.<table_name>.<field_name>');
var edit = $('<table_name>.<field_name>_nonedit');
select.style.backgroundColor = 'green';
lookup.style.backgroundColor = 'green';
text.style.backgroundColor = 'green';
edit.style.backgroundColor = 'green';

 

Cheers,

Tai Vu