Fix Add Kart
Set auto refresh Datatable on delete and add
This commit is contained in:
17
karts.html
17
karts.html
@ -200,10 +200,8 @@
|
||||
<i class="fas fa-plus"></i>
|
||||
</a>
|
||||
</h6>
|
||||
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered" id="dataTable_kart_list" width="100%" cellspacing="0">
|
||||
@ -241,23 +239,23 @@
|
||||
</div>
|
||||
<form id="kartForm">
|
||||
<div class="modal-body">
|
||||
<input type="hidden" class="form-control" id="id" value="">
|
||||
<input type="hidden" class="form-control" id="id" name="id" value="">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="form-control" id="name" placeholder="Enter kart name">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="Enter kart name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="autonomy">Autonomy</label>
|
||||
<input type="number" step="1" class="form-control" id="autonomy" placeholder="Autonomy">
|
||||
<input type="number" step="1" class="form-control" id="autonomy" name="autonomy" placeholder="Autonomy">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="comment">Comment</label>
|
||||
<textarea class="form-control" id="comment" rows="3"></textarea>
|
||||
<textarea class="form-control" id="comment" name="comment" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||||
<button type="submit" id="saveKartChanges" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -307,9 +305,8 @@
|
||||
listKarts();
|
||||
|
||||
$("#kartForm").submit(function (event) {
|
||||
console.log('prevent submit');
|
||||
$("#saveKartChanges").prop('disabled', true);
|
||||
event.preventDefault();
|
||||
console.log($(this).serialize());
|
||||
addKarts($( this ).serialize())
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user