与雇用emp的例子:我即将着色的细胞大于11000.(sysdate-hiredate的范围从大约10k到12k)。你可以使用你在查询计算领域,或者你通过一些程序填写一个,无所谓:)
select empno, ename, job, mgr, hiredate, sal, comm, deptno,
trunc((trunc(sysdate)-hiredate)) to_colour_or_not
from emp
您将需要2个动态行动,以色列在报告中:有载动作,并刷新后。如果跳过刷新之后,由于部分页面刷新,行之后不会着色,例如分页。
动态动作之一:
真动作:
$("td[headers='TO_COLOUR_OR_NOT']").each(function(){
alert($(this).text());
if(parseInt($(this).text()) > 11000){
$(this).css({"background-color":"red"});
};
});
使用一个列作为着色另一列中的条件的实施例上的区域的刷新后。始终谨慎对待您测试的内容和测试内容!例如,入职专栏是一个日期,如果有必要的话,一定要把它当作一个日期!还要小心:如果你的日期格式设置为DD-MON-YYYY,那么你必须做月份到数字的映射(JAN = 1,DEC = 12)!也许这是一个选项,以更改此列,即使日期格式...
$("td[headers='HIREDATE']").each(function(){
var i_date = $(this).text();
//date format = MM/DD/YYYY
//be carefull with date formats.
//in my case, i know my date format and know it won't change
//my code is far from a complete parse of possible date values!
var dMonth = i_date.substring(0, 2),
dDay = i_date.substring(3, 5),
dYear = i_date.substring(6);
var d = new Date(dYear, dMonth, dDay, 0, 0, 0, 0);
if(d.getFullYear() <= 1981){
//we are looping over TD elements. I want to colour the
//column ENAME in red when the condition is true for this row.
//so, $(this) = TD element we loop with. parent = TR element,
//then back to the children of the row
$(this).parent().children("td[headers='ENAME']").css({"background-color":"red"});
};
});
的第二动态作用:负载
作为真正的作用,使用相同的代码真正的行动刷新。
随着JS你可以做任何你想做的事情:你只需要知道你想绘制哪些单元格。使用[headers='']定位您想要的单元格(jquery selectors)。 而不是css(),你可以使用addClass作为例子,如果你想要的更多。
请注意:IR带有内置的鼠标悬停操作。这会导致您绘制的单元格在鼠标悬停操作时不显示其颜色。如果你不想要这个,你需要为mouseover/mouseleave事件另外一个动态的动作,并且定位那些必要的单元。
至于计划的工作:检查出DBMS_JOBS。