AlohaEditable class

Constructors

AlohaEditable(JsObject? _context, [JsObject? _event])
An Aloha editable class binding. Note that the context and event you pass here are NOT automatically retained by this class, if you want this to happen you must retain it in your client code. The main Aloha class for instance retains all proxies it uses to instantiate this class.

Properties

check bool?
Check if the object can be edited by Aloha Editor return true if Aloha Editor can handle it.
no setter
event JsObject
The event that triggered the creation of the editable, e.g the event from editableActivatedEvent. This is optional for this class but if not supplied some API calls will throw an exception.
no getter
hashCode int
The hash code for this object.
no setterinherited
id String?
Get the id of this editable
no setter
isActive bool?
True, if this editable is active for editing.
no setter
isDisabled bool?
Check whether the editable has been disabled
no setter
isEmpty bool?
Check if the content is empty.
no setter
isModified bool?
Check if the editable has been modified during the edit process Return boolean true if the editable has been modified.
no setter
proxy JsObject?
The context for the editable
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshotContent String?
Get a snapshot of the active editable as a HTML string
no setter

Methods

activate() → void
Activates an editable for editing, disables all other active items
addPlaceholder() → void
Add placeholder in editable
blur() → void
Blur the editable
destroy() → void
Destroy the editable
disable() → void
Disable this editable A disabled editable cannot be written on by keyboard
empty(String str) bool?
Check if the string is empty as far as Aloha is concerned
enable() → void
Enable this editable Reenables a disabled editable to be writeable again
getContents([bool asObject = false]) → dynamic
Get the contents of this editable as a HTML string or child node DOM objects. Boolean asObject Whether or not to retreive the contents of this editable as child node objects or as an HTML string. Defaults to string . return {string|jQuery.HTMLElement} Contents of the editable as a DOM object or an HTML string.
initPlaceholder() → void
Initialise the placeholder
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removePlaceholder([bool setCursor = false]) → void
Remove placeholder from the content. If setCursor is true, will also set the cursor to the start of the selection. However, this will be ASYNCHRONOUS, so if you rely on the fact that the placeholder is removed after calling this method, setCursor should be false ( or not set )
setContents(String content, [bool asObject = false]) → dynamic
Set the contents of this editable as a HTML string The return object is as an object or html string, default is HTML.
setUnmodified() → void
Marks the editables current state as unmodified. Use this method to inform the editable that it's contents have been saved
toString() String
String representation of the object
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getContentSerializer(JsObject context) → dynamic
Gets the content serializer function.
setContentSerializer(dynamic serializerFunction, JsObject context) → void
Sets the content serializer function. The default content serializer will just call the jQuery.html() function on the editable element (which gets the innerHTML property). This method is a static class method and will affect the result of editable.getContents() for all editables that have been or will be constructed. Dynamic serializerFunction A function that accepts a DOM element and returns the serialized XHTML of the element contents (excluding the start and end tag of the passed element). js.Proxy context, the aAloha editable context ,usually Aloha.Editable