Oracle apex Apex交互式网格如何检索特定记录
我正在使用以下方法检索网格数据:Oracle apex Apex交互式网格如何检索特定记录,oracle-apex,oracle-apex-5.1,Oracle Apex,Oracle Apex 5.1,我正在使用以下方法检索网格数据: var ig$ = apex.region("myGrid1").widget(), view = ig$.interactiveGrid("getCurrentView"); 现在我想基于两列检查特定记录:id1和id2,其中id1=1和id2=7 如何使用javascript实现这一点?您可以对每个记录进行如下迭代: //"myGrid1" should be the static id of the IG region v
var ig$ = apex.region("myGrid1").widget(),
view = ig$.interactiveGrid("getCurrentView");
现在我想基于两列检查特定记录:id1
和id2
,其中id1=1
和id2=7
如何使用javascript实现这一点?您可以对每个记录进行如下迭代:
//"myGrid1" should be the static id of the IG region
var widget = apex.region('myGrid1').widget();
var grid = widget.interactiveGrid('getViews','grid');
var model = grid.model;
var results = [];
model.forEach(function(r) {
var record = r;
//the name of the columns should be ID1 and ID2, if not
//make the necessary changes using "_" to represent "space"
var value1 = model.getValue(record,'ID1');
var value2 = model.getValue(record,'ID2');
if(value1 == 1 && value2 == 7) {
results.push(record);
}
})
console.log(results);
要测试此代码,请在控制台上执行它
要在chrome上启动控制台,只需按F12
祝你好运。嗨。你能看看我的新问题吗?我遇到了一个限制,javascript代码的字符被截断。是否可以使用some()或every()代替forEach()在交互式网格中循环?我需要一种方法来打破循环时,如果条件得到满足,无法做到这一点与forEach。-谢谢不要将Salesforce
apex
标签用于oracle apex
问题。