Skip to content

Instantly share code, notes, and snippets.

@vincentdeelen
Last active March 10, 2016 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentdeelen/707fdd92ffa81b99837a to your computer and use it in GitHub Desktop.
Save vincentdeelen/707fdd92ffa81b99837a to your computer and use it in GitHub Desktop.
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();
self.formattedSal = 10.00;
// Behaviours
self.goToDept = function(department) {
self.chosenDeptId(department);
$.get('/pls/apex/vincentdeelen/hr/emp/'+department,'',self.chosenDeptData);
};
// Show first dept by default
self.goToDept(depts[0]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment