getState

gets current values/states of controls

string|boolean|object getState(string|number id);

Parameters

idstring|numberoptional, the id of a Toolbar control

Returns

string|boolean|objectthe value/state of the control, or an object with IDs of controls and their values/states

Example

var state1 = toolbar.getState("search"); 
// -> "toolbar"
 
var state2 = toolbar.getState(); 
// -> {"search":"toolbar","edit":true,"align":"right"}

Related samples

Details

Starting from v7.0, the method can return the value/state of the control by its id:

var state1 = toolbar.getState("search"); // -> "toolbar"
 
var state2 = toolbar.getState("edit"); // -> true/false

If id of a control is not passed to the method, the method returns an object with IDs of controls and their values/states:

var state = toolbar.getState(); 
// -> {"search":"toolbar","edit":true,"align":"right"}
See also
Change log

The ability to pass the id parameter to the method is added in v7.0.

Back to top