ComponentOne ASP.NET MVC Controls
LayoutBase Class
File
c1.nav.js
Module
c1.nav
Base Class
DisposableObject
Derived Classes
FlowLayout, GridLayout, SplitLayout
Implements
ILayout

Defines the base class for the layout.

We can define our own layouts by implementing ILayout. We need write the codes for initializing, saving/loading layout, managing the tiles, painting and moving. It is a little complex. If extending from this class, it will be an easy thing as it helps us to consider these. We only need to override some methods to implement our own customizing parts.

Constructor

Properties

Methods

Constructor

constructor

constructor(options?: any): LayoutBase

Initializes a new instance of the LayoutBase class.

Parameters
Optional

JavaScript object containing initialization data for the layout.

Returns
LayoutBase

Properties

activeTile

Gets the current active tile.

Type
Tile

dashboard

Gets the DashboardLayout control which the layout is applied in.

Type
DashboardLayout

definition

Gets or sets the current layout settings as a JSON string.

This property is typically used to persist the layout settings. The maximum state of the tile is temporary and it will not be persisted.

Type
any

fullTypeName

Gets the full type name of the current object.

It should be overrided for every class which extends from this class..

Type
string

items

Gets the layout item collection.

Type
LayoutItemCollection

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
  • target: EventTarget

    Target element for the event.

  • type: string

    String that specifies the event.

  • fn: any

    Function to execute when the event occurs.

  • capture: boolean
Optional

Whether the listener is capturing.

Inherited From
DisposableObject
Returns
void

attachTo

attachTo(dashboard: DashboardLayout): void

Applies this layout to the specified DashboardLayout control.

Parameters
Returns
void

detach

detach(): void

Detaches this layout from the DashboardLayout control.

It is often used when applying the new layout, the old layout should be detached. When the layout is detached, the dashboard control shows nothing but a blank. If you want to use the layout in the dashboard again, you need call the attachTo method to apply it.

Returns
void

dispose

dispose(fullDispose?: boolean): void

Disposes the object.

Parameters
Optional

A boolean value decides wehter to keep the current status when disposing. If true, all the current status will be cleared. Otherwise, keep the current status.

Returns
void

draw

draw(): void

Draws the layout. The items should be drawn in this methods.

Returns
void

endMove

endMove(movedTile: Tile, endPosition: Point): void

Ends moving the tile at the specified postion.

Parameters
Returns
void

initialize

initialize(options: any): void

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

This method allows you to initialize the object using plain data objects instead of setting the value of each property in code.

Parameters
Returns
void

invalidate

invalidate(fullUpdate?: boolean): void

Invalidates the dashboard causing an asynchronous refresh.

Parameters
Returns
void

move

move(movedTile: Tile, position: Point): void

Moves the tile.

Parameters
Returns
void

moveTo

moveTo(tile: Tile, pt: Point): void

Moves the tile to the specified postion.

Adds the codes in this method to do the moving operation.

Parameters
Returns
void

refresh

refresh(fullUpdate?: boolean): void

Refreshes the layout.

Parameters
Returns
void

remove

remove(removedTile: Tile): boolean

Removes the tile from the layout.

Parameters
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

resize

resize(resizedTile: Tile, toPosition?: Point): boolean

Resize the tile to the specified postion.

Parameters
Returns
boolean

resizeTo

resizeTo(resizedTile: Tile, newSize: Size): boolean

Resizes the tile to the specified size.

Adds the codes to resize the tile to the specified size by pxWidth and pxHeight.

Parameters
Returns
boolean

showAll

showAll(): void

Shows all the tiles.

Returns
void

startMove

startMove(movedTile: Tile, startPosition: Point): boolean

Starts to move the tile.

Parameters
Returns
boolean

toggleSize

toggleSize(currentTile: Tile): void

Toggles the tile size.

Parameters
Returns
void