TinyMCE:API/tinymce.ui.NativeListBox/select
From Moxiecode Documentation Wiki
Contents |
[edit]
Method: select
[edit]
Summary
Selects a item/option by value. This will both add a visual selection to the item and change the title of the control to the title of the option.
[edit]
Syntax
<void> select(<String/function> v)
[edit]
Parameters
- v
- Value to look for inside the list box or a selector function.
[edit]
Examples
// Selects the example1 item inside the styleselect control of the active editor
tinyMCE.activeEditor.controlManager.get('styleselect').select('example1');
// Selects the an item by a sector function
tinyMCE.activeEditor.controlManager.get('styleselect').select(function(v) {return v == "someval";});
// Select an item in list box based in the class name of the current node
ed.onNodeChange.add(function(ed, cm, n) {
cm.get('styleselect').select(n.className);
});
