我需要在表格形式之间添加一个虚拟行,以使其在用户端更具吸引力 [英] I'm in need to add a dummy row in between a tabular form to make it more appealing at the user end

查看:67
本文介绍了我需要在表格形式之间添加一个虚拟行,以使其在用户端更具吸引力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该表格形式是在带有SQL查询的经典报表(可更新报表)上创建的. 它还具有由向导生成的MRU& MRD流程 并且区域源具有以下代码(如下所示),可以正常工作并显示如下所述的列

The Tabular form was created on a classic report with an SQL Query (updateable report). It also has a wizard generated MRU & MRD process And the region source has the following code (written below) which works fine and displays columns as stated below

select 
"ROWID",
"EVAL_SR_NO",
(SELECT SKILL_DESC FROM TB_RCMI_EVAL_SKILLS 
   WHERE SKILL_ID ="TB_RCMI_CNDT_INTV_EVAL"."EVAL_SKILL_ID" ) as
"EVAL_SKILL_ID",
"EVAL_SKILL_REMARKS"
from "#OWNER#"."TB_RCMI_CNDT_INTV_EVAL"
where eval_type='TE'and WF_ID = :P33_WF_ID

UNION ALL

select 
"ROWID",
"EVAL_SR_NO",
(SELECT SKILL_DESC FROM TB_RCMI_EVAL_SKILLS
   WHERE SKILL_ID ="TB_RCMI_CNDT_INTV_EVAL"."EVAL_SKILL_ID" ) as
"EVAL_SKILL_ID",
"EVAL_SKILL_REMARKS"
from "#OWNER#"."TB_RCMI_CNDT_INTV_EVAL"
where eval_type='GE'and WF_ID = :P33_WF_ID
order by EVAL_SR_NO

我的表格形式有3列(即Sr No& Skill是仅显示格式,而Remarks列是文本区域)的表示形式如下:

A representation of my Tabular Form having 3 columns (i.e Sr No & Skill is of display only format and Remarks column is of text area) is depicted below:

没有技巧说明

1种Java语言
2 Oracle数据库 3 Oracle DBA
4 Oracle Pl Sql
5通讯
6分析思维 7逻辑思维 8态度
9种领导才能
10个业务理解

1 Java Language
2 Oracle Database 3 Oracle DBA
4 Oracle Pl Sql
5 Communication
6 Analytical Thinking 7 Logical Thinking 8 Attitude
9 Leadership Qualities
10 Business Understanding

我需要在5号和5号之间添加一个虚拟行(仅用作显示).第6号高级职员被称为综合评价".如下图所示.

i need to add a dummy row (which will act as display only) between Sr No 5 & Sr No 6 as "General Evaluation". As shown below...

没有技巧说明

1种Java语言
2 Oracle数据库 3 Oracle DBA
4 Oracle Pl Sql
5通讯

1 Java Language
2 Oracle Database 3 Oracle DBA
4 Oracle Pl Sql
5 Communication

一般评估"

6种分析思维

7逻辑思维

8个态度

9种领导才能

10个业务理解

如果你们中的任何一个可以帮助我(有详细的答案),那将是非常有帮助的

It would be of great help if any of you could help me out with this (with an detailed answer)

我希望这些信息能对您有所帮助...如果需要提供更多信息,请告诉我

i hope this information would be help full... please let me know if i need to give in more information

等待反馈.谢谢!

(正在使用ApEX 4.1)

('m using ApEX 4.1)

推荐答案

您似乎真正需要的是一页上的2个表格形式,但是不幸的是,还不可能(现在?).那么如何解决呢?除非您真的绝对需要在一页上具有此编辑功能:否则我不会.如果您这样做(我的意思是绝对必须这样做),那么javascript就会变得有些麻烦. 我的建议:制作2个报告,提供一个编辑链接.这也是标准功能.当然,一次不会进行多个修改,但是此后最容易维护.任何风俗习惯都会让您再次思考,因此值得考虑.

What you really seem to need is 2 tabular forms on one page, which unfortunately isn't possible (yet?). How to solve this then? Unless you really absolutely need to have this editing functionality on one page: i wouldn't. If you do (and i mean absolutely must), then there is going to be fiddling involved with javascript. My advice: make 2 reports, provide an edit link. This is standard functionality too. Sure, no multiple edits at once, but this'll be easiest to maintain afterwards. Anything custom will have you ponder again afterwards, so it's worth considering.

如果您确实需要它,我认为这是解决问题的最舒适的方法:无需摆弄sql,除非增加一列.无需搞定带有双精度数的并集并按某些伪"列进行排序(因为您需要某种方式来确保双精度列在某些值之间...).

If you do really need it, i think this is the most comfortable way to go about it: NO fiddling in the sql, except maybe a column more. No screwing around with unions with duals and ordering by some "pseudo" columns (because you need some way to make sure the dual column(s) are between certain values...).

带有EMP表的示例

区域来源:

select 
"ROWID",
"EMPNO",
"ENAME",
"JOB",
"DEPTNO"
from "EMP"
where "DEPTNO" IN (10, 20)
order by "DEPTNO"

DEPTNO是隐藏的项目.排序依据非常重要,因为进一步的处理取决于行的特定顺序.关闭列标题排序功能(对报表属性中的列进行排序的复选框).

DEPTNO is a hidden item. The order by is very important, since further processing depends on a certain ordering of the rows. Turn off column header sorting (checkbox for sort for columns on the report attributes).

JavaScript:

Javascript:

function bind_for_changes(){
   //since emp is sorted by deptno, i can loop over the elements in this way
   //i also have deptno as a hidden item in the report, so that i can check its value
   //since this hidden item is the 4th editable item, its id will be f04_####
   //be sure to check the source output if you want to be sure.
   //for each input item with name f04 (deptno), do:
   //check if its value differs from our stored value.
   // if it does, but our var is still -1, then it is only the first record. Do nothing.
   // if it does and the var is not -1, then there is a difference between deptnos. 
   // for example, 10 -> 20. 
   // this change will be detected on the first row of deptno=20. So the splitter row
   // needs to be before this one.
   // The input item sits in a TD, the TD in a TR. We need to add a TR element BEFORE
   // the current one, so we get the TR and add a new one before it, with a TD in it.
   // note the colspan=3, which is the amount of displayed columns. If not sure, check the DOM.
   // Or, provide 3 TDs
   var deptno = -1;
   $("input[name='f04']").each(function(){
      if(deptno != $(this).val()){
         if(deptno == -1){
            deptno = $(this).val(); //first time, first record
            //dont change anything
         } else {
            //a change between deptno's. Add a row after the current one
            deptno = $(this).val();
            var tr = $(this).parent().parent();
            var newtr = $("<tr class='highlight-row'><td colspan=3 class='data'>In between rows!</td></tr>");
            tr.before(newtr);
         };
      };
   });
};

请注意,就像我在js注释中指出的那样:您需要了解页面将生成什么/能够读取源/知道DOM.或多或少的可编辑列可以并且将使您的代码搞砸!

Do note, like i state in the js comment: you need to be aware of what the page will generate/be able to read the source/know DOM. More or less editable columns can and will screw your code up!

例如,在我查看源代码的页面上,重要的是报告中行的结构:

For example, on my page when you view source, what matters is the structure of the row in the report:

<tr class="highlight-row">
   <td headers="EMPNO" class="data">7782</td>
   <td headers="ENAME" class="data">
      <label for="f02_0003" class="hideMeButHearMe">Ename</label>
      <input type="text" name="f02" size="12" maxlength="2000" value="CLARK"  id="f02_0003" />
   </td>
   <td headers="JOB" class="data">
      <label for="f03_0003" class="hideMeButHearMe">Job</label>
      <input type="text" name="f03" size="9" maxlength="2000" value="MANAGER"  id="f03_0003" />
      <input type="hidden" name="f01" value=""  id="f01_0003" />
      <input type="hidden" name="f04" value="10"  id="f04_0003" />
      <input type="hidden" id="fcs_0003" name="fcs" value="3C09CABCBA62BE1A064146D162012CEF">
      <input type="hidden" id="frowid_0003" name="frowid" value="AAuDjIABFAAAACTAAC" />
      <input type="hidden" id="fcud_0003" name="fcud" value="U" />
   </td>
</tr>

记下输入的ID和名称以及它们的放置位置.

Take note of the IDs and names of the inputs, and also where they're placed.

此外,自从apex 4.1(我相信)以来,表格元素后就有一个映射

Also, since apex 4.1 (i believe), there is a mapping after the table element

<input type="hidden" name="fmap" value="CHECK$01" id="fmap_001" />
<input type="hidden" name="fhdr" value="Select Row" id="fhdr_001" />
<input type="hidden" name="fmap" value="ENAME" id="fmap_002" />
<input type="hidden" name="fhdr" value="Ename" id="fhdr_002" />
<input type="hidden" name="fmap" value="JOB" id="fmap_003" />
<input type="hidden" name="fhdr" value="Job" id="fhdr_003" />
<input type="hidden" name="fmap" value="DEPTNO" id="fmap_004" />
<input type="hidden" name="fhdr" value="Deptno" id="fhdr_004" />

这可以从列属性中翻译出来.但是请务必谨慎并仔细检查.它从不伤人,您仍然需要知道输出代码.

This can be translated from the column attributes. But always be carefull and doublecheck. It never hurts and you still need to know the output code.

但是,如果所有这些听起来太高级/困难,那就不要继续学习!之后,您只会后悔. 宁可使用标准功能来实现以下目的:2个普通报表,带有指向单个记录表单页面的编辑链接! 但我认为,如果您必须这样做,那是最干净的道路.您只需要知道自己在做什么.

However, if all of this sounds too advanced/difficult, then don't go through with it! You'll only come to regret it afterwards. Rather use standard functionality for something like this: 2 normal reports with an edit link to a single record form page! But if you must, in my opinion, this is the cleanest path. You just need to know what you're doing.

这篇关于我需要在表格形式之间添加一个虚拟行,以使其在用户端更具吸引力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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