Last active
March 10, 2016 14:59
-
-
Save vincentdeelen/707fdd92ffa81b99837a to your computer and use it in GitHub Desktop.
Global variables and functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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