/
/
/
Disabling a button depending on the value

Disabling a button depending on the value

Let us suppose that it is necessary to make a button available or, on the contrary, disable it based on the value of a certain field in the list.

Let's see the description of buttons of an arbitrary list below:

  <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>

In this example, the showelem button will appear active for list items with the active column set to off. And hideelem for those with the value on.