togglebar

A button group in which one button can be toggled at any time.

  • Extends Observable
  • Syntax

    <div data-juci="togglebar" data-toggled="2">
    	<button data-juci="button">1st</button>
    	<button data-juci="button">2nd</button>
    	<button data-juci="button">3rd</button>
    </div>
    Listeners to events can be attached by using Observable#bind, or listeners can be bound in the HTML declaration of the control using on+'name of event', for e.g: onclick=handleClick(event). Listeners can be removed through Observable#unbind

    Attributes

    • data-juci {String}
      A string containing the value togglebar.
    • data-toggled {Number}
      The index of the button that has to be toggled by default.

    Methods

    • toggle(idx)
      Toggles the button at the specified index.
      Parameters:
      • idx{String}
        The index of the button that is to be toggled on.
      See:

    Events

    • toggle(eventObj) Cancellable
      Fires when user taps on a button in the togglebar which is not toggled.
      Parameters:
      • eventObj{EventObject}
        • newToggled{Number}
          The index of the button that is currently tapped.
        • oldToggled{Number}
          The index of the button that is toggled on.