DrY Optionsbox
hamishwillee
(Talk | contribs) m (Hamishwillee - Add syntax markup for javascript) |
hamishwillee
(Talk | contribs) m (Hamishwillee - Fix categories) |
||
| Line 1: | Line 1: | ||
| − | [[Category:Symbian Web Runtime]] | + | [[Category:Symbian Web Runtime]][[Category:UI]] |
{{ArticleMetaData | {{ArticleMetaData | ||
|sourcecode=[[Media:DrY Checkbox.zip]] [[Media:DrY Radiobox.zip]] [[Media:DrY Optionsbox.zip]] | |sourcecode=[[Media:DrY Checkbox.zip]] [[Media:DrY Radiobox.zip]] [[Media:DrY Optionsbox.zip]] | ||
Latest revision as of 06:46, 5 July 2012
Article Metadata
Following code snipped shows how it can be used:
dojo.require("dry.Optionsbox");
var buttonData1 = [{
title: "First",
checked: true,
id: "first item"
},{
title: "Second",
id: "2nd item"
},{
title: "Third",
id: "third item"
},{
title: "Fourth",
id: "last item"
}];
var radio = new dry.Optionsbox({title: "Radio",styleTweaker: styleTweaker,items: buttonData1,type: 'radio',changed:valueChanged}, 'controlDiv1');
var check = new dry.Optionsbox({title: "Checkbox",styleTweaker: styleTweaker,items: buttonData1,changed:valueChanged}, 'controlDiv2');
The constructor takes 2 items, where the second one is the name for the div where the Optionsbox is placed in. The first argument is a struct defining the Optionsbox properties and callback functions:
- title: title shown in the container,
- items: array of button definitions,
- type: either‘radio‘ or ‘check‘,
- changed: callback called when selection is changed,
- styleTweaker: styleTweaker for handling the themes.
Examples
- Component browser at dev.DrJukka.com/DrY/
- WRT example at Wiki: DrY Checkbox.zip
- WRT example at Wiki: DrY Radiobox.zip
- WRT example at Wiki: DrY Optionsbox.zip

