在页面提交后将焦点设置到IG中以前选择的行 [英] Setting focus to a previously selected row in IG after Page Submit

查看:31
本文介绍了在页面提交后将焦点设置到IG中以前选择的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是它的基本外观:

每当我选择左侧交互式网格上的某一行时,"选择更改[交互式网格]"动态操作都会触发并加载右侧交互式网格上的某些信息。

我可以在上面添加新行,我希望在单击"保存"(图片上没有显示,但它在"复制"按钮上方一点)后,动态操作会触发"页面加载",并在左侧交互网格上选择先前聚焦的行。

我找到要尝试的".est(Selector)"函数并尝试,如下所示:

$(".getRowId").on('click',function()
        {
            var currentRow = $(this).closest('tr');
            alert(currentRow.attr('id'));
        }
                     );

我在页面加载上使用的函数是:

$(document).ready(function()
    {
        $(currentRow(id)).focus();    
    }
                 );

函数".getRowId"位于"Selection Change[Interactive Grid]"函数中,所以我想知道这是否就是它无法工作的原因。我是否应该在"On Click"DA上启用该功能才能使其正常工作?

推荐答案

我不太明白您为什么需要提交页面,我会尝试使用默认按钮保存(插入和更新)交互式网格。此按钮不提交页面,并保留所选值。


如果您需要提交页面,我认为您的解决方案如下所示:

1-在"选择更改(交互式网格)"上创建动态操作

真正的操作是"执行javascript代码"

//set the static id field on your interactive grid and put the value on gridID variable
var gridID = "dept";
var ig$ = apex.region(gridID).widget();
var grid = ig$.interactiveGrid("getViews","grid");
var selectedRecord = grid.getSelectedRecords();
console.log(selectedRecord);
localStorage.setItem('lastSelectedRecord', JSON.stringify(selectedRecord));
2-在"页面加载"上创建动态操作

真正的操作是"执行javascript代码"

//set the static id field on your interactive grid and put the value on gridID variable
var gridID = "dept";
var ig$ = apex.region(gridID).widget();
var grid = ig$.interactiveGrid("getViews","grid");

grid.setSelectedRecords(JSON.parse(localStorage.getItem('lastSelectedRecord')));

在此测试https://apex.oracle.com/pls/apex/f?p=150297:35单击"保存22"按钮

这篇关于在页面提交后将焦点设置到IG中以前选择的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆