Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <table id="table" summary="Department List" aria-label="Departments Table"
       data-bind="ojComponent: {component: 'ojTable', 
                                data: datasource, 
                                columns: [{headerText: 'Department Id', 
                                           field: 'DepartmentId'},
                                          {headerText: 'Department Name', 
                                           field: 'DepartmentName'},
                                          {headerText: 'Location Id', 
                                           field: 'LocationId'},
                                          {headerText: 'Manager Id', 
                                           field: 'ManagerId'}]}">


                @import url('//');


  // Path mappings for the logical module names
  paths: {
    'knockout': '//',
    'jquery': '//',
    "jqueryui": "//",
    "jqueryui-amd": "//",

    "promise": "//",
    "hammerjs": "//",
    "ojdnd": "//",
    "ojs": "//",
    "ojL10n": "//",
    "ojtranslations": "//",
    "text": "//",
    "signals": "//"

  // Shim configurations for modules that do not expose AMD
  shim: {
    'jqueryui-amd': {
      exports: "$",
      deps: ['jquery']
    'jquery': {
      exports: ['jQuery', '$']
  config: {
    ojL10n: {
      merge: {
        //'ojtranslations/nls/ojtranslations': 'resources/nls/menu'
        // The following addes en-US to the r.js bundle
        //'ojtranslations/nls/ojtranslations': '../../oj/resources/nls/en-US/localeElements'

 'ojs/ojtable', 'ojs/ojcollectiontabledatasource'
], function(ko, oj, $) {
  'use strict';

  var ViewModel = function() {
     var self = this;
     self.DeptCol = ko.observable();
     self.datasource = ko.observable();
     self.serviceUrl = "";
     // parse the response
     self.parseDept = function (response){
       return {
         DepartmentId: response['DepartmentId'],
         DepartmentName: response['DepartmentName'],
         LocationId: response['LocationId'],
         ManagerId: response['ManagerId']
     // Define the oj.Model
     self.Department = oj.Model.extend({
       parse: self.parseDept,
       idAttribute: 'DepartmentId'
     // Create an instance of oj.Model
     self.myDept = new self.Department();
     // Define the collection
     self.DeptCollection = oj.Collection.extend({
       url: self.serviceUrl,
       model: self.myDept
     // set the collection to a ko variable
     self.DeptCol(new self.DeptCollection());
     // set the observable variable to as the datasource
     self.datasource(new oj.CollectionTableDataSource(self.DeptCol()));
  ko.applyBindings(new ViewModel());