javascript - 甲骨文 APEX |如何以表格形式聚焦最后添加的行

标签 javascript jquery oracle-apex tabular-form

我希望下面的代码向表格表单添加新行,并将焦点移至(添加的行)上的第一个单元格例如(#f02_0003):

    apex.widget.tabular.addRow();
for (i=1;i<100;i=i+1)
// to loop all existing row in order to get the new added row id 
        {
             if( $('#f02_'+('000'+i).slice(-4)).length()>0 )
             // to check whether the row with looped id exists or not
                {
                        continue;
                }
             else 
                {
                        $('#f02_'+('000'+(i-1)).slice(-4)).focus(); 
                        // to focus the expected added row
                        break;
                }
        }

它添加新行但是永远不要聚焦任何单元格。

请帮忙!..

最佳答案

删除循环。然后添加以下行(假设第一列下的元素名称为“f02”):

$("[name='f02']").last().focus();

关于javascript - 甲骨文 APEX |如何以表格形式聚焦最后添加的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39316429/

相关文章:

javascript - 到底如何替换:true works with element directives?

javascript - 计算 Canvas 中的像素值

javascript - 将动态下拉列表重置回初始状态

javascript - 滚动到非常长的下拉菜单的键盘输入上的元素

oracle-apex - Oracle Apex - 与无人用户进行大量 session

javascript - Z-index 和 wmode 不适用于 IE10 中的 YouTube 嵌入代码

javascript - ng-if 不在 ng-repeat 中比较 $index

jquery - ASP.NET MVC jQuery AJAX 调用 Action 方法太晚了?

oracle-apex - 在交互式网格中使用动态文件名的替换字符串进行下载

sql - 从 Oracle 中的逗号分隔变量中删除重复值