PivotBook
ํผ๋ฒ ๋ถ(PivotBook) ์ ์ฒด๋ฅผ ๊ตฌ์ฑํ๋ ์ต์์ ๋ชจ๋ธ.
Properties
explorer: PivotExplorer readonly
Pivot table explorer.
default: undefined
footer: PivotBookFooter readonly
Pivot book footer.
default: undefined
header: PivotBookHeader readonly
Pivot book header.
default: undefined
headline: PivotHeadline readonly
Pivot book headline.
default: undefined
inspector: PivotInspector readonly
Pivot table inspector.
default: undefined
listenerCount: number (opens in a new tab) readonly
๋ฑ๋ก๋ ๋ฆฌ์ค๋ ๊ฐ์๋ฅผ ๋ฐํํ๋ค.
default: undefined
tableCount: number (opens in a new tab) readonly
Number of pivot tables in this book.
default: undefined
tables: Array (opens in a new tab)<PivotBookPage> readonly
Pivot tables in this book.
default: undefined
Methods
addListener(listener): void (opens in a new tab)
์ด๋ฒคํธ ๋ฆฌ์ค๋๋ฅผ ์ถ๊ฐํ๋ค.
| Parameter | Type | Description |
|---|---|---|
| listener | IPivotBookEvents | ์ด๋ฒคํธ ๋ฆฌ์ค๋ |
beginUpdate(): void (opens in a new tab)
์ด๋ฒคํธ ๋ฐ์์ ์ผ์์ ์ผ๋ก ์ค๋จํ๋ค.
beginUpdate()์ endUpdate()๋ ์ค์ฒฉ ํธ์ถ์ ์ง์ํ๋ค.
endUpdate() ํธ์ถ ํ์๊ฐ beginUpdate() ํธ์ถ ํ์์ ๊ฐ์์ง๋ฉด ์ด๋ฒคํธ ๋ฐ์์ด ์ฌ๊ฐ๋๋ค.
์ค์: ์์ธ ๋ฐ์ ์์๋ endUpdate()๊ฐ ๋ฐ๋์ ํธ์ถ๋๋๋ก try-finally ํจํด์ ์ฌ์ฉํด์ผ ํ๋ค.
table.beginUpdate();
try {
table.setValue(0, 0, 'value1');
table.setValue(0, 1, 'value2');
table.updateRow(1, ['a', 'b', 'c']);
// ... ์ฌ๋ฌ ์์
๋ค
} finally {
table.endUpdate();
}clearListeners(): void (opens in a new tab)
๋ชจ๋ ์ด๋ฒคํธ ๋ฆฌ์ค๋๋ฅผ ์ ๊ฑฐํ๋ค.
dispose(): null
๊ฐ์ฒด๋ฅผ ํด์ ํ๊ณ null์ ๋ฐํํ๋ค.
์ฌ์ฉ ์: this._obj = this._obj.dispose();
returnย null
endUpdate(): void (opens in a new tab)
์ด๋ฒคํธ ๋ฐ์์ ์ฌ๊ฐํ๋ค.
beginUpdate() ํธ์ถ ํ์๋งํผ endUpdate()๋ฅผ ํธ์ถํด์ผ ์ด๋ฒคํธ ๋ฐ์์ด ์ฌ๊ฐ๋๋ค.
์ค์: try-finally ๋ธ๋ก์ finally์์ ํธ์ถํ์ฌ ์์ธ ๋ฐ์ ์์๋ ์คํ๋๋๋ก ํด์ผ ํ๋ค.
isUpdating(): boolean (opens in a new tab)
ํ์ฌ ์ด๋ฒคํธ ๋ฐ์์ด ์ค๋จ๋ ์ํ์ธ์ง ํ์ธํ๋ค.
returnย ์ด๋ฒคํธ ๋ฐ์์ด ์ค๋จ๋ ์ํ์ด๋ฉด true, ๊ทธ๋ ์ง ์์ผ๋ฉด false
load(cm, config, callback?): void (opens in a new tab)
Loads the pivot book with the specified configuration.
| Parameter | Type | Description |
|---|---|---|
| cm | PivotCubeManager | Cube manager instance used to manage data cubes. |
| config | PivotBookConfiguration | Pivot book configuration to load. |
| callback | (book: PivotBook) => void | Optional callback function invoked after the book is loaded. |
off(eventName, handler): boolean (opens in a new tab)
ํน์ ์ด๋ฒคํธ์์ ํธ๋ค๋ฌ๋ฅผ ์ ๊ฑฐํ๋ค.
const handler = (sender, row) => console.log(row);
table.on('onRowUpdated', handler);
table.off('onRowUpdated', handler);| Parameter | Type | Description |
|---|---|---|
| eventName | never | ์ด๋ฒคํธ ์ด๋ฆ |
| handler | IPivotBookEvents\[K] | ์ ๊ฑฐํ ์ด๋ฒคํธ ํธ๋ค๋ฌ ํจ์ |
returnย ์ ๊ฑฐ ์ฑ๊ณต ์ฌ๋ถ
on(eventName, handler): void (opens in a new tab)
ํน์ ์ด๋ฒคํธ์ ํธ๋ค๋ฌ๋ฅผ ๋ฑ๋กํ๋ค.
addEventListener()๋ณด๋ค ๊ฐํธํ ๋ฐฉ์์ผ๋ก ๊ฐ๋ณ ์ด๋ฒคํธ ํธ๋ค๋ฌ๋ฅผ ๋ฑ๋กํ ์ ์๋ค.
table.on('onRowUpdated', (sender, row, oldValues) => {
console.log('Row updated:', row);
});| Parameter | Type | Description |
|---|---|---|
| eventName | never | ์ด๋ฒคํธ ์ด๋ฆ |
| handler | IPivotBookEvents\[K] | ์ด๋ฒคํธ ํธ๋ค๋ฌ ํจ์ |
removeListener(listener): boolean (opens in a new tab)
์ด๋ฒคํธ ๋ฆฌ์ค๋๋ฅผ ์ ๊ฑฐํ๋ค.
| Parameter | Type | Description |
|---|---|---|
| listener | IPivotBookEvents | ์ด๋ฒคํธ ๋ฆฌ์ค๋ |
returnย ์ ๊ฑฐ ์ฑ๊ณต ์ฌ๋ถ
resetUpdate(): void (opens in a new tab)
์ด๋ฒคํธ ๋ฝ ์นด์ดํฐ๋ฅผ ๊ฐ์ ๋ก 0์ผ๋ก ๋ฆฌ์
ํ๋ค.
๊ฒฝ๊ณ : ์ด ๋ฉ์๋๋ ์์ธ ์ฒ๋ฆฌ ๋๋ฝ ๋ฑ์ผ๋ก ์ธํด ์ด๋ฒคํธ ๋ฝ์ด ์๊ตฌ์ ์ผ๋ก ๊ฑธ๋ฆฐ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํด์ผ ํ๋ค. ์ ์์ ์ธ ํ๋ฆ์์๋ beginUpdate()/endUpdate()๋ฅผ ์ฌ๋ฐ๋ฅด๊ฒ ์ฌ์ฉํด์ผ ํ๋ค.
// ๋๋ฒ๊น
์ด๋ ์๋ฌ ๋ณต๊ตฌ ์
if (table.isUpdating()) {
console.warn('Event lock is stuck, resetting...');
table.resetUpdate();
}save(): PivotBookConfiguration
Saves the current state of the pivot book into a configuration object.
returnย The configuration object representing the current state of the pivot book.