In a custom component I have some component params (config.xml) and I have some menu item params (default.xml).
Inside the component params I make use of the showon
attribute many times. But to keep it brief, I will show 1 example:
<field name="currency_decimals"
type="number"
default="0"
min="0"
max="3"
size="2"
/>
<field name="currency_decimals_sep"
default=","
type="text"
showon="currency_decimals!:0"
/>
As expected, the 'decimals separator' field is only visible when 'currency decimals' is not 0, because of the showon
attribute.
Next, I also made some menu item params to override this behavior on some pages. And that's where I get a bit stuck. Because my component params are set to 0 decimals, the 'decimals field' shows 'Use Global (0)'. But the 'decimal separator' field is still visible.
This is the code:
<field name="currency_decimals"
useglobal="true"
type="number"
min="0"
max="3"
size="2"
/>
<field name="currency_decimals_sep"
useglobal="true"
type="text"
showon="currency_decimals!:0"
/>
When I manually set the value to 0. The 'decimal separator' field hides. But it doesn't respond to global setting, defined by component config.
I've read the Joomla documentation on this but didn't find a solution. Any ideas on how to fix this?
All input is most welcome. Thanks! :)