Description
Call the setLeftSoftkeyLabel
method to customize
the label and the operation associated with the left softkey.
By default, the left softkey of a device is assigned to the "Options"
function, which invokes a list of menu items. The default label depends on
the current used system language (Options
for English).
For more general information on using softkeys in your widget, see Using softkeys.
Syntax
[void] window.menu.setLeftSoftkeyLabel(String label, Function callbackfunc)
or
[void] menu.setLeftSoftkeyLabel (String label, Function callbackfunc)
Arguments:
label
A text string specifies the label to be shown on the left softkey.
callbackfunc
A reference to the callback function, which will be called by the system when the left softkey is pressed.
Return value:
This method does not return a value.
Remarks:
setLeftSoftkeyLabel
is supported for WRT 7.1 and
later.
The default label and "Options" function of the left softkey can be
restored by calling the setLeftSoftkeyLabel
with an empty
string ('') specified for the label
argument and the callbackfunc
argument
set to null
.
Example code:
function switchToSettingsView()
{
// implement and show settings
...
// customize the left softkey
window.menu.setLeftSoftkeyLabel
('Back', returnToMainView);
}
function returnToMainView()
{
// show main view
...
// restore the default left softkey
window.menu.setLeftSoftkeyLabel
('', null);
}