cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="oj-flex oj-margin">
  <!-- ko foreach: {data: employees, as: 'emp'} -->
  <div data-bind="ojModule: { name: 'XKNNPw',
                  params: {
                      employee: emp,
                      onselect: $parent.selectEmployee
                  } }" class="employee">
  </div>
  <!-- /ko -->
</div>
<div class="oj-margin">
  <h2>Selected data</h2>
  <pre data-bind="text: ko.toJSON(selectedEmployee, null, 2)"></pre>
</div>
            
          
!
            
              // Alta CSS included through settings
.employee {
  cursor: pointer;
}
            
          
!
            
              // require configuration imported from
// https://codepen.io/jimj/pen/GqqwQz.js
require(['knockout',
  'ojs/ojcore',
  'ojs/ojknockout',
  'ojs/ojmodule'
], function(ko, oj) {
  'use strict';

  // The following overrides are necessary to load a
  // module from a codepen. These overrides are defined
  // at http://www.oracle.com/webfolder/technetwork/jet/jsdocs/oj.ModuleBinding.html
  // relative path for modelPath because leading '/'
  //caused require to drop the .js suffix
  oj.ModuleBinding.defaults.modelPath = '../../jimj/pen/';
  oj.ModuleBinding.defaults.viewPath =
    'text!/jimj/pen/';

  // data
  var employees = [{
    id: 100,
    name: "Cordell Walker"
  }, {
    id: 101,
    name: "James Trivette"
  }, {
    id: 102,
    name: "Alexandra Cahill Walker"
  }, {
    id: 103,
    name: "'Big Dog' CD Parker"
  }, {
    id: 104,
    name: "Sydney Cooke"
  }, {
    id: 105,
    name: "Raymond Firewalker"
  }, {
    id: 106,
    name: "Francis Gage"
  }, {
    id: 107,
    name: "Trent Malloy"
  }, {
    id: 108,
    name: "Carlos Sandoval"
  } ];

  var ViewModel = function() {
    var self = this;

    self.employees = employees;
    self.selectedEmployee = ko.observable({});
    self.selectEmployee = function(employee) {
      self.selectedEmployee(employee);
    };
  };
  ko.applyBindings(new ViewModel());
  window.ko = ko;
});
            
          
!
999px
Loading ..................

Console