qbo.Depend extended to respond to Button clicks

posted Apr 6, 2018, 5:16 PM by Unknown user   [ updated Apr 6, 2018, 5:18 PM ]
qbo.Depend can now toggle the 'disabled' class on the basis of a button click.

To assign this dependency, use the pattern: {buttonId} = click as the 'depends' parameter.

Example:
<div id="buttonTestsDiv">
    <label for ="buttonTest1">Button Test 1</label>
    <div class="controls">
      <input type="button" id="testButton" value="Click me!"/>
      <input type="text" id="buttonTest1" data-behavior="Depend" data-depend-options="{{'depends': 'testButton = click', 'condition': 'and',                         'disabledClass': 'disabled'}}"/>
    </div>
</div>

Tests: Theme.ashx/Specs?Library=Behaviors\Spec.Depend.js

Comments