Kind: global class
- PageBuilder
- new PageBuilder(rowsPerPage)
- instance
- .addRow(row) ⇒
PageBuilder
- .addSpacer([count]) ⇒
PageBuilder
- .getContent() ⇒
Array.<Array.<object>>
- .getPageHeight() ⇒
number
- .getViewedPageHeight() ⇒
number
- .setScrollIndex(index) ⇒
PageBuilder
- .setRowsPerPage(rowsPerPage) ⇒
PageBuilder
- .increaseScrollIndex() ⇒
PageBuilder
- .decreaseScrollIndex() ⇒
PageBuilder
- .clear() ⇒
PageBuilder
- .addRow(row) ⇒
- static
- .scrollIndex :
number
- .content :
Array.<Array.<object>>
- .scrollIndex :
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)
Returns the content of the page.
Kind: instance method of PageBuilder
Example
page.getContent()
Returns the height of the page.
Kind: instance method of PageBuilder
Example
page.getPageHeight()
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()
The index of the scroll bar.
Kind: static constant of PageBuilder
The content of the page.
Kind: static constant of PageBuilder