tinymce.ui.Collection

Control collection, this class contains control instances and it enables you to perform actions on all the contained items. This is very similar to how jQuery works.

Examples

someCollection.show().disabled(true);

Constructors

name summary defined by
Collection() Constructor for the collection. tinymce.ui.Collection

Methods

name summary defined by
active() Sets/gets the active state on the items in the current collection. tinymce.ui.Collection
add() Adds new items to the control collection. tinymce.ui.Collection
addClass() Adds a class to all items in the collection. tinymce.ui.Collection
disabled() Sets/gets the disabled state on the items in the current collection. tinymce.ui.Collection
each() Executes the specified callback on each item in collection. tinymce.ui.Collection
eq() Makes the current collection equal to the specified index. tinymce.ui.Collection
exec() Executes the specific function name with optional arguments an all items in collection if it exists. tinymce.ui.Collection
filter() Filters the collection item based on the specified selector expression or selector function. tinymce.ui.Collection
fire() Fires the specified event by name and arguments on the control. This will execute all bound event handlers. tinymce.ui.Collection
hasClass() Returns true/false if the class exists or not. tinymce.ui.Collection
hide() Hides the items in the current collection. tinymce.ui.Collection
indexOf() Finds the index of the specified control or return -1 if it isn't in the collection. tinymce.ui.Collection
name() Sets/gets the name contents of the items in the current collection. tinymce.ui.Collection
off() Unbinds the specified event and optionally a specific callback. If you omit the name parameter all event handlers will be removed. If you omit the callback all event handles by the specified name will be removed. tinymce.ui.Collection
on() Binds a callback to the specified event. This event can both be native browser events like "click" or custom ones like PostRender. The callback function will have two parameters the first one being the control that received the event the second one will be the event object either the browsers native event object or a custom JS object. tinymce.ui.Collection
prop() Sets/gets the specific property on the items in the collection. The same as executing control.(); tinymce.ui.Collection
remove() Remove all items from collection and DOM. tinymce.ui.Collection
removeClass() Removes the specified class from all items in collection. tinymce.ui.Collection
reverse() Returns a new collection of the contents in reverse order. tinymce.ui.Collection
selected() Sets/gets the selected state on the items in the current collection. tinymce.ui.Collection
set() Sets the contents of the collection. This will remove any existing items and replace them with the ones specified in the input array. tinymce.ui.Collection
show() Shows the items in the current collection. tinymce.ui.Collection
slice() Slices the items within the collection. tinymce.ui.Collection
text() Sets/gets the text contents of the items in the current collection. tinymce.ui.Collection
toArray() Returns an JavaScript array object of the contents inside the collection. tinymce.ui.Collection
visible() Sets/gets the selected state on the items in the current collection. tinymce.ui.Collection

Constructors

Collection

public constructor function Collection(items:Array)

Constructor for the collection.

Parameters

Methods

active

active():tinymce.ui.Collection

Sets/gets the active state on the items in the current collection.

Return value

add

add(items:Array):tinymce.ui.Collection

Adds new items to the control collection.

Parameters
Return value

addClass

addClass(cls:String):tinymce.ui.Collection

Adds a class to all items in the collection.

Parameters
Return value

disabled

disabled():tinymce.ui.Collection

Sets/gets the disabled state on the items in the current collection.

Return value

each

each(callback:function):tinymce.ui.Collection

Executes the specified callback on each item in collection.

Parameters
Return value

eq

eq(index:Number):tinymce.ui.Collection

Makes the current collection equal to the specified index.

Parameters
Return value

exec

exec(name:String, ...:Object):tinymce.ui.Collection

Executes the specific function name with optional arguments an all items in collection if it exists.

Examples
collection.exec("myMethod", arg1, arg2, arg3);
Parameters
Return value

filter

filter(selector:String):tinymce.ui.Collection

Filters the collection item based on the specified selector expression or selector function.

Parameters
Return value

fire

fire(name:String, args:Object):tinymce.ui.Collection

Fires the specified event by name and arguments on the control. This will execute all bound event handlers.

Parameters
Return value

hasClass

hasClass(cls:String):Boolean

Returns true/false if the class exists or not.

Parameters
Return value

hide

hide():tinymce.ui.Collection

Hides the items in the current collection.

Return value

indexOf

indexOf(ctrl:Control):Number

Finds the index of the specified control or return -1 if it isn't in the collection.

Parameters
Return value

name

name():tinymce.ui.Collection

Sets/gets the name contents of the items in the current collection.

Return value

off

off(name:String, callback:function):tinymce.ui.Collection

Unbinds the specified event and optionally a specific callback. If you omit the name parameter all event handlers will be removed. If you omit the callback all event handles by the specified name will be removed.

Parameters
Return value

on

on(name:String, callback:String):tinymce.ui.Collection

Binds a callback to the specified event. This event can both be native browser events like "click" or custom ones like PostRender. The callback function will have two parameters the first one being the control that received the event the second one will be the event object either the browsers native event object or a custom JS object.

Parameters
Return value

prop

prop(name:String, value:Object):tinymce.ui.Collection

Sets/gets the specific property on the items in the collection. The same as executing control.();

Parameters
Return value

remove

remove():tinymce.ui.Collection

Remove all items from collection and DOM.

Return value

removeClass

removeClass(cls:String):tinymce.ui.Collection

Removes the specified class from all items in collection.

Parameters
Return value

reverse

reverse():tinymce.ui.Collection

Returns a new collection of the contents in reverse order.

Return value

selected

selected():tinymce.ui.Collection

Sets/gets the selected state on the items in the current collection.

Return value

set

set(items:Array):tinymce.ui.Collection

Sets the contents of the collection. This will remove any existing items and replace them with the ones specified in the input array.

Parameters
Return value

show

show():tinymce.ui.Collection

Shows the items in the current collection.

Return value

slice

slice(index:Number, len:Number):tinymce.ui.Collection

Slices the items within the collection.

Parameters
Return value

text

text():tinymce.ui.Collection

Sets/gets the text contents of the items in the current collection.

Return value

toArray

toArray():Array

Returns an JavaScript array object of the contents inside the collection.

Return value

visible

visible():tinymce.ui.Collection

Sets/gets the selected state on the items in the current collection.

Return value

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.