【发布时间】:2017-10-01 14:03:47
【问题描述】:
在 oracle 中,表格形式的顶点列可以使用它们各自的流 ID 进行控制。流 ID 的示例是 --> f01 f02
我想要做的是将 x(列号)的值连接到
document.wwv_flow.f+x.toString()+[i]
我很自信不是处理情况的正确方法,但我不知道正确的方法是什么。
注意:$v(APEX_ITEM) 返回顶点项的值。
完整代码:
for (var i = 0; i < document.wwv_flow.f01.length; i++) //document.wwv_flow.f01.length returns the number rows
{
var isChecked=$(document.wwv_flow.f01[i]).is(":checked");
if(isChecked){
var copyrow;
apex.widget.tabular.addRow();
copyrow = apex.jQuery(apex.widget.tabular.gTabForm).find("tr").last().insertBefore(apex.jQuery(apex.widget.tabular.gTabForm).find("tr").first());
i++;
copyrow.hide();
var colcount = $(document.wwv_flow.f01[i]).closest("tr").children("td").length; //colcount is the number of columns
for(var x = 4; x < (colcount-4); x++){ //x is the column number
if(x < 10){
x = "0"+x;
}
console.log("Col #"+x+" Value: "+$v((document.wwv_flow.f+x.toString()+[i]))); //!!
}
copyrow.show( "slow" );
}
}
【问题讨论】:
-
目前认为这可能与stackoverflow.com/questions/8677034/…的情况有关
-
这段代码连接整个数组的原因是什么?由于 apex 的标记,还有更好的方法可以通过 JS 可靠地访问选项卡表单中的列。
-
其实我在离开之前直接找到了解决方案。明天早上将发布解决方案。 〜从手机发送
-
你能详细说明这段代码的用途吗?你最终想要达到什么目标?
-
当然!它会遍历并获取每一行的值,你可以用它做任何你想做的事情。在我的示例中,我将其简单地打印到控制台。
标签: javascript jquery loops iteration oracle-apex