Sha256: 6902c3199b8ff322cfa95eb269f8f984e882cfc46c750beb01310b4bedc62079

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

<table class="uikit-table">
  <thead>
    <tr>
      <th>Date</th>
      <th>Item number</th>
      <th>Amount</th>
    </tr>
  </thead>

  <tbody>
    {% for i in (1..3) %}
    <tr class="item-row">
      <td data-label="Date">{% include forms/date-field.html %}</td>
      <td data-label="Item number">{% include forms/text-field.html pattern="[0-9]*" %}</td>
      <td data-label="Amount">{% include forms/text-field.html placeholder="$" pattern="[0-9]*" type="number" step="0.01" %}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>

{% include buttons/link-button.html text="Add another item" className="uikit-btn--tertiary uikit-btn--block" onclick="addRow()"%}

<script type="text/javascript">
  var addRow = function() {
    var xhr = new XMLHttpRequest();
    xhr.responseType = 'document';

    xhr.open('GET', window.location.href);
    xhr.onload = function() {
      var tableRow = this.response.querySelector('.item-row');
      var tableBody  = document.querySelector('.uikit-table tbody');

      tableBody.appendChild(tableRow);
    };

    xhr.send();
  }
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dta_rapid-0.7.4 _includes/forms/item-table.html