用於Spin Viewer的JavaScript API參考
getComponent(componentId)
返回對查看器使用的Viewer SDK元件的引用。 該網頁可以使用這種方法來擴展或定制出廠時查看器的行為。 僅在 initComplete
查看器回調已運行,否則查看器邏輯可能尚未建立元件。
*
元件ID*
- {String}
查看器使用的查看器SDK元件的ID。 此查看器支援以下元件ID:
元件ID |
查看器SDK元件類名 |
---|---|
參數管理器 |
s7sdk.ParameterManager |
容器 |
s7sdk.common.container |
媒體集 |
s7sdk.set.MediaSet |
spinView |
s7sdk.set.SpinView |
縮放InButton |
s7sdk.common.ZoomInButton |
縮小按鈕 |
s7sdk.common.ZoomOutButton |
zoomResetButton |
s7sdk.common.ZoomResetButton |
全屏按鈕 |
s7sdk.common.FullScreenButton |
closeButton |
s7sdk.common.CloseButton |
spinLeftButton |
s7sdk.common.PanLeftButton |
旋轉右鍵 |
s7sdk.common.PanRightButton |
使用SDK API時,必須使用正確、完全限定的SDK命名空間,如中所述 查看器SDK。
有關特定元件的詳細資訊,請參閱查看器SDK API文檔。
{Object}
對查看器SDK元件的引用。 方法返回 null
的 componentId
不是受支援的查看器元件,或者如果查看器邏輯尚未建立該元件。
<instance>.setHandlers({
"initComplete":function() {
var spinView = <instance>.getComponent("spinView");
}
})