更改动态oracle顶点报告中的字段

也不是新手和先进的顶级用户,
但,
我对主要的客户端网络语言非常天真,现在我需要面对它。 等等。
我在这里有一个例子 – 用户: 测试和密码测试 。 我基于同样的jquery和javascript函数,由Tony Andrews先生回答。 在我的应用示例中,当优先级字段被更改时,它会输入A字段的值,当它不是0时,也不是null。 它简单地将该结果乘以该字段。
我正在尝试在更改时从优先级字段中添加更改优先级脚本。 例如:何时将id = 1的优先级更改为1, id = 2的优先级必须更改为3 – 来自id = 1的原始优先级。
我知道这是一个非常基本的算法,但我不知道如何及时,在javascript或jQuery调用apex上。 我一直在尝试对报告进行更复杂的操作,但我需要先了解基础知识。

为了澄清我的查询报告和javascript执行是:

select distinct apex_item.checkbox2(10,r.ID) ID, apex_item.text(11,r.ID) ID_2, apex_item.text(20,r.PRIORIDADE) PRIORITY, apex_item.text(30,1) a, apex_item.SELECT_LIST_FROM_LOV(31,r.PRIORIDADE,'LISTAPRIORIDADES',NULL,'NO') PRIORITY_LOV, apex_item.text(40,null) b, (select seq_id from apex_collections c where collection_name = 'COLECAO' AND c001 = r.id )sequencial from REPRIORIZA r order by id; //javascript execution, on dynamic action: var target = apex.jQuery(this.triggeringElement).closest('tr').find('input[name="f30"]') console.log(target) var source = apex.jQuery(this.triggeringElement).closest('tr').find('input[name="f20"]') console.log(source) var result = target.val() * source.val(); target.val(result); console.log(target) var target2 = apex.jQuery(this.triggeringElement).closest('tr').find('input[name="f40"]') console.log(target) var source2 = apex.jQuery(this.triggeringElement).closest('tr').find('input[name="f11"]') console.log(source2) var result2 = source2.val(); target2.val(result2); 

问候,

有几种方法可以做到这一点,我的建议如下:

1 – 在编写apex_item代码时,在select中使用属性’p_attributes’和’p_item-id’,如下所示:

https://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_item.htm#AEAPI211

https://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_item.htm#AEAPI206

 apex_item.text( p_idx => 20, p_value => 1, p_attributes => 'data-id="' || CUSTOMER_ID || '"', p_item_id => 'priority' || CUSTOMER_ID) priority, apex_item.text( p_idx => 30, p_value => 1, p_attributes => 'data-id="' || CUSTOMER_ID || '"', p_item_id => 'a' || CUSTOMER_ID) a, apex_item.SELECT_LIST_FROM_LOV( p_idx => 31, p_value => 1, p_lov => 'LISTAPRIORIDADES', p_attributes => 'data-id="' || CUSTOMER_ID || '"', p_show_null => 'NO', p_item_id => 'lov' || CUSTOMER_ID) PRIORITY_LOV 

执行此操作时,您可以轻松访问同一行中的每个项目。 这些选择来自我工作区中的示例表,将这些数据调整到您的表中。

2 – 创建动态动作以在更改lov时触发,此动态动作应执行javascript代码。

在此处输入图像描述

3 – 在这个DA的javascript代码中,您可以使用以下代码获取该行的每个元素:

 var lineId = this.triggeringElement.getAttribute('data-id'); var lovItem = document.getElementById('lov' + lineId); var aItem = document.getElementById('a' + lineId); var priorityItem = document.getElementById('priority' + lineId); 

在此处输入图像描述

现在,您可以使用lovItem,aItem和priorityItem字段执行所有操作。

4 – 在你的示例页面中,id列是顺序的,所以你可以得到下一行只是递增lineId变量,如下所示:

 var nextLineId = lineId + 1; var nextLovItem = document.getElementById('lov' + nextLineId); var nextAItem = document.getElementById('a' + nextLineId); var nextPriorityItem = document.getElementById('priority' + nextLineId); 

*如果值不是连续的,也许您可​​以使用超前或滞后函数在“p_attributes”参数的apex_item中再创建一个属性。 https://oracle-base.com/articles/misc/lag-lead-analytic-functions

好,

对于我问的可能答案的情况是:

 var target = apex.jQuery(this.triggeringElement).closest('tr').find('input[name="f30"]') //console.log(target) var source = apex.jQuery(this.triggeringElement).find('input[name="f20"]') console.log(source) console.log('valor default: '.concat(source.context.defaultValue)) //var lista = apex.jQuery(this.affectedElements[0].innerHTML).find('input[name="f20"]') var lista = apex.jQuery(source.context.form).find('input[name="f20"]') console.log('lista: '.concat(lista)) for (var x=0;x 

此代码将更改另一行中存在的值之间的值。 以前的贡献!