gpt4 book ai didi

javascript - 页面提交后将焦点设置到 IG 中先前选择的行

转载 作者:行者123 更新时间:2023-11-30 14:18:58 24 4
gpt4 key购买 nike

基本上是这样的:

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

我可以在上面添加新行,我希望这样,在我点击“保存”(图中未显示,但它位于“复制”按钮上方)后,页面上会触发一个动态操作加载并选择左侧交互式网格中先前聚焦的行。

enter image description here

我找到了“.closest(selector)”函数来尝试,就像这样:

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

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

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

“.getRowId”函数在“选择更改 [交互式网格]”函数中,所以我想知道这是否是它不起作用的原因。我是否应该在“单击时”DA 上使用该功能才能使其正常工作?

最佳答案

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


如果你需要提交页面,我想你的解决方案应该是这样的:

1 - 在“选择更改(交互式网格)”上创建动态操作 enter image description here

真正的 Action 是“执行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 - 在“页面加载”上创建动态操作 enter image description here

真正的 Action 是“执行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点击“Save22”按钮

关于javascript - 页面提交后将焦点设置到 IG 中先前选择的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53061135/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com