bubblePosition()

Since: Editor 1.3

Reposition an editing bubble when it is visible.
Please note - this property requires the Editor extension for DataTables.

Description

When bubble() is called, it will automatically position the editing bubble above the elements to which the edit is attached (by calling this method internally!), however, if your document changes, for example inserting another element, the position of the cells to be edited might move, which would leave the bubble looking 'disconnected' if its position was not updated. This method provides that ability.

Note that Editor will automatically call this method when the window is resized, in order to keep the bubble attached to its host elements.

Type

bubblePosition()

Update the position of an editing bubble to match the position of the host element(s) (first parameter in bubble()) based on their current position in the document.

Returns:

DataTable.Editor: Editor instance

Example

:

$('#myTable').on('click', 'tbody td', function () {
	editor.bubble(this);

	// Insert an element causing a layout update in the document
	$(this).append('Currently being edited');

	// Alter the position of the bubble to keep it attached visually
	editor.bubblePosition();
});