Javascript
From Achievo/ATK Wiki
|
ATK Howto: Javascript
|
This howto demonstrates some simple Javascript features that are built into ATK.
Hiding or showing an attribute or relation depending on the value of another attribute
If you have an attribute that should hide or show depending on the value of another attribute, you can use the following construct:
&$this->add(new atkAttribute('myAttribute',........ $attr = &$this->add(new atkBoolAttribute(........ $attr->addOnChangeHandler("if (newvalue=='no') { hideAttrib('myAttribute'); } else { showAttrib('myAttribute'); }");