assign model
unknown
php
3 years ago
2.6 kB
5
Indexable
<br>
<div class="well card card-body bg-dark">
<div style="width: 100%; overflow: auto;scrollbar-base-color:#ffeaff">
<table class="table table-striped fontYantra" id="vehicle_brand_model_table">
<thead>
<tr class="fontYantra"
style="font-size:16px;letter-spacing:1px;">
<th>ID </th>
<th>VEHICLE BRAND </th>
<th>VEHICLE MODEL </th>
<th>ACTION </th>
<th>UPDATE </th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
var dataTable2 = $('#vehicle_brand_model_table').dataTable( {
"processing": true,
"serverSide": true,
"ajax":{
url :"datalist_vehicle_brand_model.php?vehicle_id=0", // json datasource
type: "get", // method,by default get
error: function() { // error handling
$(".vehicle_brand_model_table-error").html("");
$("#vehicle_brand_model_table").append('<tbody class="table-error"><tr><th colspan="15" class="font2">No data found in the server</th></tr></tbody>');
$("#vehicle_brand_model_table_processing").css("display","none");
}
}
});
});
function add_vehicle_brand_model()
{
var vehicle_brand_id = $('#vehicle_brand_id').val();
var vehicle_brand = $('#vehicle_brand').val();
var vehicle_model = $('#vehicle_model').val();
$.ajax({
url: "ajax_add_vehicle_brand_model_action.php",
type: "POST",
data: {
vehicle_brand_id : vehicle_brand_id,
vehicle_brand : vehicle_brand,
vehicle_model : vehicle_model,
},
success: function (response)
{
alert(response);
var dataTable2 = $('#vehicle_brand_model_table').dataTable( {
"processing": true,
"serverSide": true,
"ajax":{
url :"datalist_vehicle_brand_model.php?vehicle_id=0", // json datasource
type: "get", // method,by default get
error: function() { // error handling
$(".vehicle_brand_model_table-error").html("");
$("#vehicle_brand_model_table").append('<tbody class="table-error"><tr><th colspan="15" class="font2">No data found in the server</th></tr></tbody>');
$("#vehicle_brand_model_table_processing").css("display","none");
}
}
});
},
error: function(xhr, status, error){
var errorMessage = xhr.status + ': ' + xhr.statusText
alert('Error : ' + errorMessage);
}
});
}Editor is loading...