Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Create/Update Toggle Buttons Dynamically #315

@tneil

Description

@tneil

Ability to create and dynamically change the properties of a toggle button dynamically after the DOM for a screen has been loaded.

Need to add the following JS functions to the toggle button:

  • show(); [Completed]
  • hide(); [Completed]
  • remove(); [Completed]
  • setOnCaption('Yes'); [Completed]
  • setOffCaption('No'); [Completed]
  • getOnCaption(); [Completed]
  • getOffCaption(); [Completed]
  • enable() [Completed]
  • disable() [Completed]
  • Add the data-bb-disabled attribute to the Data Attribute Reference wiki page [Completed]
  • bb.toggle.style(element); [Completed]
  • Update the existing toggle sample page to just show the control working [Completed]
  • Add sample page to show how to manipulate control with JavaScript similar to the Dynamic Buttons page [Completed]
// Create toggle button
var toggle = document.createElement('div');
toggle.setAttribute('data-bb-type','toggle');
toggle.setAttribute('data-bb-on', 'On');
toggle.setAttribute('data-bb-off', 'Off');
toggle.onchange = function() {alert('foo');};

toggle = bb.toggle.style(toggle);

document.getElementById('toggleContainer').appendChild(toggle);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions