克隆行(复制记录)在Oracle Apex不工作
Clone Row (copy records) in Oracle Apex is not working
<script type="text/javascript">
function fn_CloneRow(pThis) {
$(pThis).parent().parent().clone().appendTo($(pThis).parent().parent().parent());
}
通过使用上面的代码,我能够将表格中单击的行克隆到表格的底部,但是我无法存储它们。当我更改克隆行的值时,在提交页面时将更新原始行,而不是添加新行。
这是因为在克隆行时也克隆了包含主键的元素。根据我的想法,可以使用以下元素:
- 清空包含PK的输入元素(您需要找出这是否是数组f01或任何其他)。您的问题没有提供上下文),或者如果您使用rowid,则清除名称为"frowid"的输入元素
- 清空包含行校验和的输入元素。这是一个名称为"fcs"的输入元素
- 将包含记录状态(name = fcud)的输入元素设置为'C'。它用于确定对其执行什么操作。"D"是新的,"C"是改变的,"U"是更新的——我猜。这不是在任何文档中,但通过检查html和javascript你可以找到它。
如果不使用parent().parent()...
,而是使用.closest(...)
var newRow = $(pThis).closest('tr').clone();
$('input[name=f01]', newRow).val(""); //input with PK value -- make sure this matches your situation!!!
$('input[name=frowid]', newRow).val(""); //or if the form works with rowid, use this
$('input[name=fcs]', newRow).val(""); //clear the checksum
$('input[name=fcud]', newRow).val("C"); //set the record status
newRow.appendTo($(pThis).closest('table')); //finally, append the row to the table
相关文章:
- 单击Oracle APEX导航栏项目时的条件操作
- 如何动态重新加载Oracle APEX 5.0树
- 如何防止在oracle apex 5.0中提交页面后点击
- 在Oracle Apex 5.0中,无法在侧面导航列表模板中使用title属性
- 在Oracle Apex的javascript部分中获取富文本编辑器的HTML文本
- 如何在没有Javascript的情况下使多个提交按钮在Oracle Apex上工作
- 是否可以阻止 Oracle Apex 提交页面,直到用户单击该页面上的刷新按钮
- 如何在 oracle apex 5.0 中手动折叠痕迹导航区域
- 是否可以在javascript或oracle apex 5.0中捕获已取消的页面提交或取消确认框
- Oracle APEX - 如何在打印时缩放区域以适应单个页面
- Oracle Apex Canvas to blob in PNG 格式保存到项目
- jQuery Load Issue and Oracle ApEx v4.1
- Oracle Apex 5.0:当操作栏设置为不显示时,您可以使用交互式报告上的操作菜单按钮吗
- 在Oracle ApEx中设置更改其他文本项时文本字段的显示值
- 根据Oracle APEX中的复选框自动刷新IRR
- Oracle Apex Ghosting Javascript外部文件(bug?)
- Oracle Apex中的Javascript;无法调用未定义的“”的方法子字符串;
- Oracle APEX&JavaScript-传递函数NOT值中文本字段的名称
- Oracle ApeX(PL/SQL)-从JavaScript变量创建Bind变量
- 文本字段中的Oracle APEX逗号替换项