【发布时间】:2018-10-23 10:22:43
【问题描述】:
我正在尝试通过编写以下代码从 Oracle APEX 的交互式网格中获取所有选定的记录。我还将 #myStaticIgId 声明为我的报告的静态 ID。
var record, USER_NAME;
var x = '';
var l_role = $v("P2_ROLE");
var l_justification = $v("P2_JUSTIFICATION");
var l_date = $v("P2_DATE");
//Identify the particular interactive grid
var ig$ = apex.region("myStaticIgId").widget();
//Fetch the model for the interactive grid
var grid = ig$.interactiveGrid("getViews","grid");
//Fetch the model for the interactive grid
var model = ig$.interactiveGrid("getViews","grid").model;
//Fetch selected records
var selectedRecords = apex.region("myStaticIgId").widget().interactiveGrid("getViews","grid").view$.grid("getSelectedRecords");
alert(selectedRecords.length);
//Loop through selected records
for (idx=0; idx < selectedRecords.length; idx++) {
//Get the record
record = model.getRecord(selectedRecords[idx][0]);
alert(record);
//Get the current value for USER_NAME
USER_NAME = model.getValue(record,"USER_NAME");
// USER_NAME = 'Abha';
alert('submit 2');
}
我为返回记录值而编写的警报语句返回 NULL 给我。
您能否建议,需要做什么才能在记录变量中获得正确的记录值。
问候, 阿卜哈
【问题讨论】:
标签: oracle-apex