×
Namespaces

Variants
Actions
Revision as of 06:46, 5 July 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

DrY Optionsbox

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code ExampleArticle
Created: symbianyucca (16 May 2010)
Last edited: hamishwillee (05 Jul 2012)
DrY Optionsbox component is loosely based on Guarana Button implementation, basically it implements both radio and check buttons as well as the container for these buttons in it.

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

Go to DrY Index

This page was last modified on 5 July 2012, at 06:46.
43 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×