CKEditor 4 Documentation

CKEDITOR.dom.iterator

Files

Represents the iterator class. It can be used to iterate over all elements (or even text nodes in case of enlargeBr set to false) which establish "paragraph-like" spaces within the passed range.

// <h1>[foo</h1><p>bar]</p>
var iterator = range.createIterator();
iterator.getNextParagraph(); // h1 element
iterator.getNextParagraph(); // p element

// <ul><li>[foo</li><li>bar]</li>
// With enforceRealBlocks set to false the iterator will return two list item elements.
// With enforceRealBlocks set to true the iterator will return two paragraphs and the DOM will be changed to:
// <ul><li><p>foo</p></li><li><p>bar</p></li>
Defined By

Properties

CKEDITOR.dom.iterator
view source
: CKEDITOR.filterreadonly
Iterator's active filter. ...

Iterator's active filter. It is set by the getNextParagraph method when it enters a nested editable.

Available since: 4.3

CKEDITOR.dom.iterator
view source
: Boolean
Whether the iterator should create a transformable block if the current one contains text and cannot be transformed. ...

Whether the iterator should create a transformable block if the current one contains text and cannot be transformed. For example new blocks will be established in elements like <li> or <td>.

Defaults to: false

CKEDITOR.dom.iterator
view source
: Boolean
Whether to include <br> elements in the enlarged range. ...

Whether to include <br> elements in the enlarged range. Should be set to false when using the iterator in the CKEDITOR.ENTER_BR mode.

Defaults to: true

CKEDITOR.dom.iterator
view source
: CKEDITOR.filterreadonly
Default iterator's filter. ...

Default iterator's filter. It is set only for nested iterators.

Available since: 4.3

CKEDITOR.dom.iterator
view source
: Boolean
...

Defaults to: false

CKEDITOR.dom.iterator
view source
: CKEDITOR.dom.rangereadonly
Defined By

Methods

CKEDITOR.dom.iterator
view source
new( range ) : CKEDITOR.dom.iterator
Creates an iterator class instance. ...

Creates an iterator class instance.

Parameters

Returns

CKEDITOR.dom.iterator
view source
( node, startFromSibling, lastNode ) : CKEDITOR.dom.nodeprivate
Gets the next element to check or null when the lastNode or the range's root is reached. ...

Gets the next element to check or null when the lastNode or the range's root is reached. Bookmarks are skipped.

Available since: 4.4.6

Parameters

Returns

CKEDITOR.dom.iterator
view source
( [blockTag] )
Returns the next paragraph-like element or null if the end of a range is reached. ...

Returns the next paragraph-like element or null if the end of a range is reached.

Parameters

  • blockTag : String (optional)

    Name of a block element which will be established by the iterator in block-less elements (see enforceRealBlocks).

    Defaults to: 'p'