Skip to content

Instantly share code, notes, and snippets.

View vincentdeelen's full-sized avatar

Vincent vincentdeelen

View GitHub Profile
@vincentdeelen
vincentdeelen / emp_query.sql
Created March 10, 2016 15:05
Employee query for table data
SELECT emp.empno
, emp.ename
, emp.job
, NVL(TO_CHAR(emp.mgr),'-') mgr
, TO_CHAR(emp.hiredate, 'DD-MON-YYYY') hiredate
, emp.sal
, emp.comm
, emp.deptno
FROM emp
, dept
@vincentdeelen
vincentdeelen / dept_query.sql
Created March 10, 2016 15:04
Department Query for tabs
SELECT *
FROM dept
<!-- Folders -->
<section id="knockoutSection" class="col col-4">
<nav>
<ul class="departments" data-bind="foreach: departments">
<li class="" data-bind="text: $data,
css: { selected: $data == $root.chosenDeptId() },
click: $root.goToDept">
</li>
</ul>
</nav>
section#knockoutSection{
background:#f8f8f8;
}
nav{
background:#e8e8e8;
padding:10px;
margin: 0px;
}
nav ul{
margin: 0px;
@vincentdeelen
vincentdeelen / knockout_page_load.js
Created March 10, 2016 15:00
On page load action
$.getJSON( "/pls/apex/vincentdeelen/hr/dept", function( data ) {
depts = $.map(data.items, function (el) {
return el.dname;
});
ko.applyBindings(new EmpDeptViewModel());
});
@vincentdeelen
vincentdeelen / knockout_global.js
Last active March 10, 2016 14:59
Global variables and functions
// Variables
var depts;
// Functions
function EmpDeptViewModel() {
// Data
var self = this;
self.departments = depts;
self.chosenDeptId = ko.observable();
self.chosenDeptData = ko.observable();
@vincentdeelen
vincentdeelen / checkRows
Created April 30, 2014 09:11
Check the affected rows after page submit.
// Create an array of of the empno's
var empArr = $v('P1_EMPNOS').split(':')
// Loop over the array
for ( var i = 0; i < empArr.length; i++ ){
// Look for the employee and find the checkbox of that row. Then set the checkbox property to 'checked'.
$('td[headers="EMPNO"] input[value="'+empArr[i]+'"]').parent().parent().find('.row-selector').prop('checked', true)
}
@vincentdeelen
vincentdeelen / hideEmptyRows
Created April 16, 2014 10:20
Hide the empty table rows
$('#report_dept10 .uReportStandard tBody tr:first()').hide()
$('#report_dept20 .uReportStandard tBody tr:first()').hide()
@vincentdeelen
vincentdeelen / addClasstoRows
Created April 16, 2014 10:15
add classes to each table row, except for the empty rows
$('#report_dept10 .uReportStandard tBody tr:not(:first)').each(
function(){
$(this).addClass( "emp ui-widget-content" );
var idVal = $(this).find('td[headers="EMPNO"]').html();
$(this).first('td').attr("id",idVal);
}
)
$('#report_dept20 .uReportStandard tBody tr:not(:first)').each(
function(){
$(this).addClass( "emp ui-widget-content" );
@vincentdeelen
vincentdeelen / orderEmpNulls
Created April 16, 2014 10:07
Order the two tables using nulls first
select empno
, ename
, job
, deptno
from(
select null as empno
, null as ename
, null as job
, null as deptno
from emp