Disable a button depending on value

From ISPWiki
Jump to: navigation, search


To make a button available/unavailable depending on a list field.

Following is description of buttons on a list:

  <metadata name="list" type="list" key="id">
    <toolbar>
      <toolbtn func="list.new" type="new" img="t-new" name="newelem" default="yes"/>
      <toolbtn func="list.hide" type="new" img="t-lock" name="hideelem">
        <show name="active" value="on"/>
      </toolbtn>
      <toolbtn func="list.show" type="new" img="t-lock" name="showelem">
        <hide name="active" value="on"/>
      </toolbtn>
    </toolbar>
    ...
  </metadata>

showelem will be shown for list elements, which active column displays off. shideelem will be shown for those having on. для тех у кого значение on.

See for more details on buttons description