Sha256: 9b774df7484a5754a3c47d096b91d3c23ef7368953f075012452f1147894983b

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

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

  <tbody>
    <tr class="item-row">
      <td data-label="Amount">
        {% 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>
  </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

4 entries across 4 versions & 1 rubygems

Version Path
dta_rapid-0.7.3 _includes/forms/item-table.html
dta_rapid-0.7.2 _includes/forms/item-table.html
dta_rapid-0.7.1 _includes/forms/item-table.html
dta_rapid-0.7.0 _includes/forms/item-table.html