KONtx.element.TextGrid

createsa text grid Object for paging text

The text grid element extends the KONtx.element.Text Object to provide paging functionality to very long text through the use of the page indicator. This element is designed to mimic a grid and reports appropriate paging information to the page indicator.

Extends

KONtx.element.Text

Example

Properties

Property

Type

Description

anchorStyle

String

Controls how an Object is aligned to the vOffset property. Two values you can use are topLeft and baseline.

color

String

The preferred method of setting the color of the text is to use the CSS styles Object.

data

String

The text that the text Object draws. If data has a value it takes precedence, followed by text, and then label. For example:this.data = this.config.data || this.config.text || this.config.label;

element

Type

Type of the element set to Text.

firstLine

String

First line of text.

font

String

The preferred method of setting the font is to use the CSS styles Object instead of this property.

label

String

The displayed text.

scrolling

String

Direction and type of animated scrolling, values can be: off, left, right, autoLeft, or autoRight.

styles

Object

CSS styles applied to the text

text

String

The displayed text. Takes precedence over label.

totalLines

int

Number of total lines of text.

truncation

String

This tag allows you to specify that if the width of the text Object is too small for the text, truncate it intelligently using an ellipsis. The location in string where truncation begins can be none, center, or end.

visibleLines

int

Number of visible lines of text.

wrap

Boolean

Indicator if the text will wrap or should be displayed in a single line. Default value is false. When setting the wrap property always ensure that the styles.width is properly set or the text will disappear.

Methods

Object attachAccessory(Object accessory);

Companion methods for attaching controls with the attachToSource() method.

Object attachAccessories(Object accessory1, Object accessory2, Object accessory3…);

Companion methods for attaching controls with the attachToSource() method.

int getCurrentPage();

Returns the zero-based index of the current page of data.

int getPageCount();

Returns the number of pages in the dataset. Returns Math.ceil(this.totalLines/this.visibleLines).

int getStartLine();

Returns the line number of the first line of the current page.

void initialize();

Initializes the text element.

void setText(String text);

Sets the value of the text element based on the given text parameter. Available in KONtx 1.2 and above.

Object shift(String direction);

Shifts the grid to the page based on the parameter direction (left or right).

Table of Contents