JSFiddle - React, Tailwind, and code Playground

by pomansur

HTML

<div id="tab-club" class="tab-pane active">
<div class="table-responsive">
<table id="club" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<td class="text-left">Группа клиентов</td>
<td class="text-right">Приоритет</td>
<td class="text-right">Цена</td>
<td class="text-left">Дата начала</td>
<td class="text-left">Дата окончания</td>
<td></td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<td colspan="7"></td>
<td class="text-left">
<button class="btn btn-primary" title="" data-toggle="tooltip" onclick="addClub();" type="button" data-original-title="Добавить">
+
</button>
</td>
</tr>
</tfoot>
</table>
</div>
</div>

JavaScript

var club_row = 0;
function addClub() {

    html  = '<tr id="club-row' + club_row + '">';
    html += '  <td class="text-left"><select name="product_club[' + club_row + '][customer_group_id]" class="form-control">';
    <?php foreach ($customer_groups as $customer_group) { ?>
    html += '      <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo addslashes($customer_group['name']); ?></option>';
    <?php } ?>
    html += '  </select></td>';
    html += '  <td class="text-right"><input type="text" name="product_club[' + club_row + '][priority]" value="" placeholder="<?php echo $entry_priority; ?>" class="form-control" /></td>';
    html += '  <td class="text-right"><input type="text" name="product_club[' + club_row + '][price]" value="" placeholder="<?php echo $entry_price; ?>" class="form-control" /></td>';
    html += '  <td class="text-left" style="width: 20%;"><div class="input-group date"><input type="text" name="product_club[' + club_row + '][date_start]" value="" placeholder="<?php echo $entry_date_start; ?>" data-date-format="YYYY-MM-DD" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></td>';
    html += '  <td class="text-left" style="width: 20%;"><div class="input-group date"><input type="text" name="product_club[' + club_row + '][date_end]" value="" placeholder="<?php echo $entry_date_end; ?>" data-date-format="YYYY-MM-DD" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></td>';
    html += '  <td class="text-left" style="width: 5%;"><input type="checkbox" name="product_club[' + club_row + '][club]" value="1" /><span class="list_club_marker"><span class="list_club_list" style="background: #ccc none repeat scroll 0 0;"><?php echo $entry_club; ?></span></span></td>';
    html += '<td class="text-left" style="width:...