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

Create/Update Radio Button Dynamically #421

Closed
tneil opened this issue Oct 26, 2012 · 5 comments
Closed

Create/Update Radio Button Dynamically #421

tneil opened this issue Oct 26, 2012 · 5 comments

Comments

@tneil
Copy link
Collaborator

tneil commented Oct 26, 2012

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

  • show() [Completed]
  • hide() [Completed]
  • remove() [Completed]
  • Dynamic way to create/style a radio button after screen is inserted into the DOM [Completed]
  • Update the existing radio 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]
@tneil
Copy link
Collaborator Author

tneil commented Oct 26, 2012

Creating the radio button dynamically should be similar to that of the button control

// Create the element just like you would in a normal screen declaration
var radio = document.createElement('input');
radio.setAttribute('type','radio');
radio.setAttribute('name', 'group1');
radio.setAttribute('value', 'foo');
radio.onclick = function() {
        alert(this.value);
    };

// Apply our styling
radio = bb.radio.style(radio);

// Insert it into the screen and update the scroller
document.getElementById('radioContainer').appendChild(radio);
bb.refresh();

@lyricidal
Copy link
Contributor

I've got show, hide, and remove done - will send pull request in a few minutes

tneil pushed a commit that referenced this issue Oct 26, 2012
#421 - Added show, hide, remove to radio buttons
@tneil
Copy link
Collaborator Author

tneil commented Oct 26, 2012

Cool.. only the dynamic creation and samples updates left to go.

I updated the wiki page and the change log

@karancan
Copy link
Contributor

Cool, @lyricidal got to it slightly before I could :)

tneil pushed a commit that referenced this issue Nov 9, 2012
@tneil
Copy link
Collaborator Author

tneil commented Dec 11, 2012

Wiki has been updated so this can now be closed

@tneil tneil closed this as completed Dec 11, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants