Open robingram opened 4 years ago
Do you happen to remember what the name was of the field that this wasn't working for?
Only from reading back my previous post. Looks like it was "CanViewType".
My guess is there's some custom JS within the CMS itself using this particular field which then interferes with Display Logic.
Using
dev-master
on SS 4.4.Bit of a strange one this and I was wracking my brains for about a day before I got an idea of what was going on.
We have a
DataObject
with a number of fields that use Display Logic. Two of these areListboxField
controls that usedisplayIf
to control their visibility based on the value of anOptionsetField
(not the same option set, different for each list box). The code to create these fields is virtually identical but for one of them the list box would never display on page load, although it would show based on the click, i.e. if I changed the option and then changed it back.The best I could get from debugging is that the
onmatch
event for$('div.display-logic-master :checkbox, div.display-logic-master :radio')
would not fire for this particular control, although it would for the other.In desperation I started trying different things and eventually I renamed the DB field that was being referenced by
displayIf
and suddenly it started working. For some reason the code did not like the original name of the field which was "CanViewType". As far as I know this isn't a reserved word but it seemed to be affecting how Display Logic worked.We've written a migration to change the field name so we've worked around it but thought you should be aware of this since it took me a looooong time to track down.