Phone API Reference - UI Classes (Widgets) - Widget (Base Class) - setSoftkeysByList
Phone API Reference - UI Classes (Widgets) - Widget (Base Class) - setSoftkeysByList
Â
setSoftkeysByList
Description
Sets up multiple softkeys at once. Assigning more than four softKeys causes the fourth softkey to be a More softkey, which cycles the other three softkeys through the list.
Basic Example:Â
 exampleObj.setSoftkeysByList( (Array)softKeys ); |
The argument softKeys that is passed into the setSoftkeysByList method should be an array of parameters object as described below. See the examples for more information.
Parameters
Name | Required | Type | Default | Description |
---|---|---|---|---|
label | Yes | string | Â | Label to display above the key. |
handler | Yes | function | Â | Function to execute when the softkey is pressed. This function is assigned as Widget.onsoftkeyX (X being the softkey's number.) |
icon | No | widget | Â | Instance of a image widget for display. |
color | No | string | Â | For D6X phones only, can only use 'skbgcolor' (default color), 'skdialcolor (green)', or 'skerasecolor' (red), If color is not present, or any other color string is used, skbgcolor will be rendered. |
Examples
setSoftkeysByList with two softkeys
testWidget.setSoftkeysByList([
    {
        'label' : 'Test1',
        'handler' : Test1,
        'icon' : app.images.softKeys.select,
        'color' : 'skdialcolor'
    },
    {
        'label' : 'Test2',
        'handler' : Test2
    }
]); |
Â