Skip to content

Latest commit

 

History

History
168 lines (129 loc) · 5.55 KB

PageBuilder.md

File metadata and controls

168 lines (129 loc) · 5.55 KB

PageBuilder

Kind: global class

new PageBuilder(rowsPerPage)

Defines a new page: It's a sort of collection of styled rows.

Param Type Description
rowsPerPage number

The number of rows per page. Default is 100. Useful for scrolling.

pageBuilder.addRow(row) ⇒ PageBuilder

Add a new styled row to the page.

Kind: instance method of PageBuilder

Param Type Description
row parameters.<object>

The styled row to add.

Example

page.addRow({ text: 'Hello World', color: 'white' })
page.addRow({ text: 'Hello World', color: 'white' }, { text: 'Hello World', color: 'white' })

pageBuilder.addSpacer([count]) ⇒ PageBuilder

Add an empty row to the page. (like
in HTML)

Kind: instance method of PageBuilder

Param Type Default Description
[count] number 1

The number of empty rows to add.

Example

page.addEmptyRow()
page.addEmptyRow(2)

pageBuilder.getContent() ⇒ Array.<Array.<object>>

Returns the content of the page.

Kind: instance method of PageBuilder
Example

page.getContent()

pageBuilder.getPageHeight() ⇒ number

Returns the height of the page.

Kind: instance method of PageBuilder
Example

page.getPageHeight()

pageBuilder.getViewedPageHeight() ⇒ number

Returns the height of the viewed page. It excludes the rows that are not visible.

Kind: instance method of PageBuilder
Example

page.getViewedPageHeight() // returns the height of the page that is visible

pageBuilder.setScrollIndex(index) ⇒ PageBuilder

Changes the index of the scroll bar.

Kind: instance method of PageBuilder

Param Type Description
index number

The index of the scroll bar.

Example

page.setScrollIndex(10)

pageBuilder.setRowsPerPage(rowsPerPage) ⇒ PageBuilder

Changes the number of rows per page.

Kind: instance method of PageBuilder

Param Type Description
rowsPerPage number

The number of rows per page.

Example

page.setRowsPerPage(10)

pageBuilder.increaseScrollIndex() ⇒ PageBuilder

Increases the index of the scroll bar.

Kind: instance method of PageBuilder
Example

page.increaseScrollIndex()

pageBuilder.decreaseScrollIndex() ⇒ PageBuilder

Decreases the index of the scroll bar.

Kind: instance method of PageBuilder
Example

page.increaseScrollIndex()

pageBuilder.clear() ⇒ PageBuilder

Clears the page.

Kind: instance method of PageBuilder
Since: 1.2.0
Example

page.clear()

PageBuilder.scrollIndex : number

The index of the scroll bar.

Kind: static constant of PageBuilder

PageBuilder.content : Array.<Array.<object>>

The content of the page.

Kind: static constant of PageBuilder