DocumentComponent class abstract
The main component. DocumentComponent has access to HtmlDocument.
- Inheritance
-
- Object
- Component
- RenderComponent
- DocumentComponent
Constructors
Properties
- baseInnerElement → Element?
-
no setterinherited
- baseInnerHtml ↔ String
-
Sanitizes and sets the baseInnerHtml of this component.
Will throw ComponentNoIdException if there is no
id=""
attribute with the same id value found inside the baseInnerHtml string. This ensures that the DOM is in sync with the object (meaning that the component with id test will really be rendered into DOM withid="test"
in the tag.getter/setter pairinherited - elem → Element
-
Returns the DOM
Element
of this component by doingquerySelector('$id')
.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- htmlElem → HTMLElement
-
no setterinherited
- id ↔ String
-
Setting the component with new ID is basically not recommended. It will
change the real HTML ID of this element rendered in DOM too, and will
throw ComponentDuplicateIdException when the new ID already exists.
getter/setter pairinherited
- mathMlElem → MathMLElement
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- svgElem → SVGElement
-
no setterinherited
Methods
-
addOnChangeTo(
Element node, void onChange(Event)) → void -
Creates an onChange event on
node
(has to be anElement
orDocument
type). Call this in loadEventHandlers.inherited -
addOnClickTo(
Element node, void onClick(Event)) → void -
Creates an onClick event on
node
(has to be anElement
orDocument
type). Call this in loadEventHandlers.inherited -
addSubscription(
StreamSubscription subs) → void -
A generic method to add an event subscription which will also get
cancelled when unloadEventHandlers is called.
inherited
-
addSubscriptions(
Iterable< StreamSubscription> subs) → void -
A generic method to add (bulk) event subscriptions which will also get
cancelled when unloadEventHandlers is called.
inherited
-
assertDuplicateId(
String id) → void -
inherited
-
contains(
Node node) → bool -
Contains checks whether a node is contained in this component.
Can only be used by StringComponent if the component has been attached.
inherited
-
init(
) → Future< void> -
isRendered(
) → bool -
Check if the component is rendered at DOM or not.
inherited
-
loadEventHandlers(
) → void -
Place all your event listener here.
Use add event methods (like addOnClickTo).
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
postRender(
) → Future< void> -
inherited
-
postUnrender(
) → Future< void> -
inherited
-
preRender(
) → Future< void> -
inherited
-
preUnrender(
) → Future< void> -
inherited
-
queryByClass(
String elemClass) → NodeList -
Does elem.querySelectorAll(.elemClass) to select all
element that have matched class.
inherited
-
queryById(
String id) → Element? -
Does elem.querySelector(#id) to select an element under this
component.
inherited
-
renderAfter(
Element element) → Future< void> -
Renders this component after an element with ID
elementId
. This also checks whether the parent has a valid ID.inherited -
renderAppend(
Element parentElement) → Future< void> -
Renders this component inside the element with ID
parentId
, appended. This also checks whether the parent exists.inherited -
renderPrepend(
Element parentElement) → Future< void> -
Renders this component inside the element with ID
parentId
, prepended. This also checks whether the parent exists.inherited -
renderTo(
Element parentNode) → Future< void> -
Renders this component on an element with ID
parentId
. You can override this method for example to add animations and other things. Just make sure to call super.renderTo to really render the component to the DOM. Will throw ComponentNoParentException ifparentId
cannot be found in the DOM.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
unloadEventHandlers(
) → void -
Unloads all event subscriptions previously added under loadEventHandlers.
inherited
-
unrender(
) → Future< void> -
Removes this component from the DOM, setting
parentId
to null. Will throw ComponentNotRenderedException if it has not been rendered.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited