使用 APEX 18.2。当模型发生特定更改时,我正在收听 IG 的网格模型以设置发票的净金额项目,使用以下代码:
(function($) {
$(function() {
/*gRegionStaticId is the variable hodlds the IG that owns the model. */
$(gRegionStaticId).on("interactivegridviewmodelcreate", function(event, ui) {
var sid,
model = ui.model;
console.log('modelCreated');
if (ui.viewId === "grid") {
sid = model.subscribe({
onChange: function(type, change) {
if (type !== "set" && type !== "move" && type !== "metaChange" && type !== "insert" && type !== "clearChanges") {
/*"pFlowStepId" is page's number. gSetNetAmount is the global variable holds the function to set net amount.*/
$s("P" + $v('pFlowStepId') + "_NET_AMOUNT", gSetNetAmount().toString());
//alert('&APP_PAGE_ID');
}
}
});
}
});
});
})(apex.jQuery);
File URLs
代码存储在从页面属性调用的静态文件中。gRegionStaticId 和 gSetNetMaount 是定义的全局变量,并分配了拥有我正在收听的模型的 IG 的静态 id 以及在Function and global variables
页面属性中分别计算净额的函数。我这样做是为了动态使用代码,而不是在多个页面中复制它。问题(我认为)是File URL
使用上述代码加载静态文件的属性在Function and global variables
页面属性设置全局变量之前运行。
有没有办法在加载静态文件之前设置变量?或者也许将值传递给静态文件?