MAF.element.TextGrid

Provides paging functionality on very long text through the use of a page or scroll indicator.

new MAF.element.TextGrid()

Example

createView: function () {
   this.controls.scrollIndication = new MAF.control.ScrollIndicator({
      styles: {
         width: 20,
         height: this.height,
         hAlign: 'right'
      }
   }).appendTo(this);

   this.controls.textGrid = new MAF.element.TextGrid({
      styles: {
         width: this.width - this.controls.scrollIndication.width,
         height: this.height
      }
   }).appendTo(this).attachAccessories(this.controls.scrollIndication);
}

Configs

Defines if the grid needs to behave like a carousel. True will show the first view again after the last view has passed. Default false.

scrolling : {Integer}

Enables you to scroll through the page line by line instead of paging.

Methods

animate(config) inherited

Parameters:

NameTypeDescription
configObject

A config object

Fires:

attachAccessories(arguments) → {Class}

This will take a array of components and will attach them to this component using the attachAccessory method.

Parameters:

NameTypeDescription
argumentsArray

Array with classes able to attach to a source component.

Returns:

This component.

attachAccessory(accessory) → {Class}

This will take a single component and attach it to this component. This will trigger events to the class.

Parameters:

NameTypeDescription
accessoryClass

Class which is able to attach to a source component.

Returns:

This component.

freeze() → {Class} inherited

Freezes this component. Screen renders no longer trigger until thawed.

Returns:

This component.

getAbsolutePosition() → {Object} inherited

Give back the position relative to its first positioned ancestor element

Returns:

{hOffset:Number, vOffset: Number}

getCurrentPage() → {Number}

Returns:

The page the component is currently on. Pages start at 0.

getPageCount() → {Number}

Returns:

The number of pages this component has.

getStartLine(pagenum) → {Number}

Parameters:

NameTypeDescription
pagenumNumber

Pagenumber

Returns:

The first line of the page supplied by pagenum.

getText() inherited

Get which text is displayed on this component.

getView() → {Class} inherited

Returns:

Returns the view this class is appended on.

hide() → {Class} inherited

Hides this component.

Returns:

This component.

initialize() inherited

Initialize the class

setText(text)

Set which text to display on this component.

Parameters:

NameTypeDescription
textString

The text

shift(direction) → {Class}

Parameters:

NameTypeDescription
directionString

A direction the page will change to. (left,right)

Returns:

This component.

show() → {Class} inherited

Shows this component.

Returns:

This component.

thaw() → {Class} inherited

Thawes this component. Screen renders can trigger again.

Returns:

This component.

Events

onAnimationEnded

Fired when a animation on this component has ended.

onAppend

Fired when component has appended to a parent. Update visual appearances by applying a Theme style and rendering the skin.

onChange

Fired when a change happened.

onLayoutChange

Fired when a the layout of the component has changed.