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

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     } ]);

 

Return to Documentation Home I Return to Sangoma Support