傳回快速檢視控制項中組成控制項的資料繫結是否完整。
語法
quickViewControl.isLoaded();
傳回值
類型:布林值。
描述:true 表示組成控制項的資料繫結已完成;false,否則。
備註
在主要表單 OnLoad 事件期間,快速檢視控制項中組成控制項的資料繫結可能無法完成,因為控制項繫結的快速檢視表單可能未載入。 因此,在組成控制項上使用 getAttribute 或任何資料相關方法可能無法運作。 快速檢視控制項的 isLoaded 方法有助於判斷快速檢視控制項中組成控制項的資料繫結狀態。
Example
下列範例程式碼示範如何使用 isLoaded 方法來檢查繫結狀態,然後擷取快速檢視控制項中組成控制項繫結的資料行值。
function getAttributeValue(executionContext) {
var formContext = executionContext.getFormContext();
var quickViewControl = formContext.ui.quickForms.get("<QuickViewControlName>");
if (quickViewControl != undefined) {
if (quickViewControl.isLoaded()) {
// Access the value of the column bound to the constituent control
var myValue = quickViewControl.getControl(0).getAttribute().getValue();
console.log(myValue);
// Search by a specific column present in the control
var myValue2 = quickViewControl.getControl().find(control => control.getName() == "<AttributeSchemaName>").getAttribute().getValue();
console.log(myValue2);
return;
}
}
else {
console.log("No data to display in the quick view control.");
return;
}
}