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.


                  <dom-module id="my-grid">

<vaadin-grid id="main">
      <col name="name.first">
      <col name="name.last">
      <col name="email">

<paper-button on-click="clickevt" raised>MESSAGE</paper-button>

<div id="templatewrapper" style="display: none;">
  <template is="dom-bind">
                <style>.userdata {-webkit-flex: 1; flex: 1; max-height: 20px;}
                .usercolumn { display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; }</style>
                <div class="userdetails" style="display: -webkit-flex; display: flex; height: 100px;cursor: default;">
                    <!--<paper-button raised><iron-icon icon="vaadin-icons:check"></iron-icon>Assign task</paper-button>-->
                    <div class="usercolumn">
                        <div class="userdata">hi</div>
                        <div class="buttonsWrapper" style="display: -webkit-flex; display: flex; margin: 10px;">
                            <paper-button on-click="clickevt" raised>MESSAGE</paper-button>
            is: "my-grid",
            ready: function(){
var grid = this.$.main;
              var templateWrapper = document.getElementById("templatewrapper");
var template = templateWrapper.querySelector("template");

function getUserDetails(user) {
  template.user = user;
  return templateWrapper.querySelector(".userdetails").outerHTML;
  grid.size = 20;
  grid.items = function(params, callback) {
    // Fetch the JSON data from a URL
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function() {
      if (xhr.readyState == XMLHttpRequest.DONE) {
        if (xhr.status == 200) {
          var json = JSON.parse(xhr.responseText);
    var rowsNeeded = params.count > 0 ? params.count : 10;"GET", "" + rowsNeeded, true);

  // Add a row details generator
  grid.rowDetailsGenerator = function(rowIndex) {
    var elem = document.createElement('div');
    elem.setAttribute('class', 'userdetailswrapper');

    grid.getItem(rowIndex, function(error, item) {
      if (!error) {
        elem.innerHTML = getUserDetails(item);

    return elem;

  var detailsOpenIndex = -1;

  // Show details for the selected row
  grid.addEventListener('selected-items-changed', function() {
    grid.setRowDetailsVisible(detailsOpenIndex, false);
    var selected = grid.selection.selected();
    if (selected.length == 1) {
      grid.setRowDetailsVisible(selected[0], true);
      detailsOpenIndex = selected[0];
   clickevt: function(){
       alert('button clicked');