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.


                	<!-- General -->
	<script src="//"></script>

  <!-- Data Provider-->
  <script type="text/javascript" src="//"></script>

	<!-- GoldenLayout -->
	<script type="text/javascript" src="//"></script>
	<link type="text/css" rel="stylesheet" href="//" />
	<link type="text/css" rel="stylesheet" href="//" />

	<!-- SlickGrid -->
	<link rel="stylesheet" type="text/css" href="//" />
	<link rel="stylesheet" type="text/css" href="//" />

	<link rel="stylesheet" type="text/css" href="//" />
	<script type="text/javascript" src="//"></script>

	<script type="text/javascript" src="//"></script>
	<script type="text/javascript" src="//"></script>
	<script type="text/javascript" src="//"></script>



                .ui-widget *{
	vertical-align: middle;
	font: 8pt Arial, sans-serif;

	line-height: 20px;


                var myLayout = new GoldenLayout({
    type: 'row',
      type: 'component',
        title:'FTSE 100 (1-50)',
      componentName: 'stockGrid',
      componentState: { 
        symbols: [
      type: 'component',
      componentName: 'stockGrid',
        title:'FTSE 100 (51-100)',
      componentState: {

var StockGridComponent = function( container, state ) {
  this._container = container;
  this._state = state;
  this._grid = null;
  this._stockDataProvider = new StockDataProvider();
  this._columns = [
    {id: "symbol", name: "Symbol", field: "symbol"},
    {id: "company", name: "Company", field: "company"},
    {id: "price", name: "Price", field: "price"},
    {id: "change", name: "Change", field: "change"},
    {id: "changeRel", name: "Change %", field: "changeRel"},
    {id: "volume", name: "Volume", field: "volume"}
  this._options = {
    editable: false,
    enableAddRow: false,
    enableCellNavigation: true

  container.on( 'open', this._scheduleGridCreation, this );

* This method is used to get around a chrome-bug that manifests itself when using popout windows with Slickgrid
* in Codepens.
* SlickGrid appends a custom style element to the head section and checks for its presence using the document.styleSheets property.
* This seems to cause a number of issues ( 
* The specific problem here is, that when opening a new popout window, GoldenLayout moves all link elements from
* the body to the head section (links are in the body in Codepens). Chrome only updates its document.styleSheets array once
* these stylesheets have been loaded - which is correct.
* What isn't correct is, that Chrome defers adding the styletag - which doesn't need loading - to the document.styleSheets array until
* all dynamically added link elements are loaded.
* To recap: this will happen if all of these conditions are true
* - Have link elements in body instead of head
* - Use SlickGrid - I've never seen anything else access the document.styleSheets array
* - Open Popout window - only then does GoldenLayout move link tags around
* The work-around is to defer SlickGrid's initialisation until all stylesheets have been loaded - which can be checked
* by attaching event listeners  to the link tag's "load event" or - to make sure that we don't miss a stylesheet that has
* already been loaded - poll the link elements sheet property
StockGridComponent.prototype._scheduleGridCreation = function() {
  var interval = setInterval(function(){
    var stylesheetNodes = $('link[rel=stylesheet]'), i;
    for( i = 0; i < stylesheetNodes.length; i++ ) {
      if( stylesheetNodes[ i ].sheet === null ){
    clearInterval( interval );
  }.bind( this ), 10 );

StockGridComponent.prototype._createGrid = function() {
  this._grid = new Slick.Grid( 
    this._stockDataProvider.getStocksBySymbol( this._state.symbols ), 

  this._container.on( 'resize', this._resize, this );
  this._container.on( 'destroy', this._destroy, this );

StockGridComponent.prototype._resize = function() {

StockGridComponent.prototype._destroy = function() {

myLayout.registerComponent( 'stockGrid', StockGridComponent );