LayoutItem Class

File
c1.nav.js
Module
c1.nav
Base Class
DisposableObject
Derived Classes
Group, Tile
Show
   

Defines the base class for the layoutitem. Now there are two kinds of layoutitems: Tile and Group.

Constructor

Properties

Methods

Constructor

constructor

constructor(opts?: any): LayoutItem

Initializes a new LayoutItem.

Parameters
Returns
LayoutItem

Properties

hostElement

Gets the outest element which represents this layoutitem.

Type
HTMLElement

layout

Gets the layout which owns this item.

Type
LayoutBase

parent

Gets the parent which owns this layoutitem.

It could be a Group or a LayoutBase.

Type
any

Methods

addEventListener

addEventListener(target: EventTarget, type: string, fn: any, capture?: boolean): void

Adds an event listener to an element owned by this Control.

The control keeps a list of attached listeners and their handlers, making it easier to remove them when the control is disposed (see the dispose and removeEventListener methods).

Failing to remove event listeners may cause memory leaks.

Parameters
Inherited From
DisposableObject
Returns
void

dispose

dispose(fullDispose?: boolean): void

Disposes the object.

Parameters
Returns
void

draw

draw(): void

Draws the layout item.

Adds the codes to implement the paiting parts.

Returns
void

initialize

initialize(options: any): void

Initializes the object by copying the properties from a given object.

Parameters
Returns
void

remove

remove(): boolean

Removes the current layoutitem from its parent.

Returns
boolean

removeEventListener

removeEventListener(target?: EventTarget, type?: string, fn?: any, capture?: boolean): number

Removes one or more event listeners attached to elements owned by this Control.

Parameters
Inherited From
DisposableObject
Returns
number

render

render(container?: HTMLElement): HTMLElement

Renders the layoutitem in the specified container.

Parameters
Returns
HTMLElement