共用方式為


客戶

提供對方法的存取權,以判斷正在使用哪個用戶端、用戶端是否連線到伺服器,以及正在使用的裝置類型。

語法

context.client;

適用於

模型導向應用程式、畫布應用程式和入口網站。

屬性

禁用捲動

停用元件的捲動功能。 模型導向和畫布應用程式都支援此屬性。

類型boolean

Methods

方法 Description 適用於
get客戶端 傳回一個值,指出指令碼正在哪個用戶端執行。 模型導向和畫布應用程式
getFormFactor 傳回使用者正在使用的裝置類型的相關資訊。 模型導向和畫布應用程式
是離線的 傳回伺服器是線上還是離線的資訊。 模型導向應用程式
isNetwork可用 傳回網路是否可用的資訊 模型導向應用程式

Example

private createHTMLTableElement(): HTMLTableElement {
    let tableElement: HTMLTableElement = document.createElement("table");
    tableElement.setAttribute("class", "SampleControlHtmlTable_HtmlTable");
    let key: string = "Example Method";
    let value: string = "Result";
    tableElement.appendChild(this.createHTMLTableRowElement(key, value, true));
    key = "getFormFactor()";
    value = String(this._context.client.getFormFactor());
    tableElement.appendChild(this.createHTMLTableRowElement(key, value, false));
    key = "getClient()";
    value = String(this._context.client.getClient());
    tableElement.appendChild(this.createHTMLTableRowElement(key, value, false));
}

Power Apps 元件架構 API 參考
Power Apps 元件架構概觀