ajax attempt
This commit is contained in:
@@ -40,26 +40,29 @@
|
||||
</html>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
function fetch_user_data(query = '') {
|
||||
$.ajax({
|
||||
url:"{{ route('live_search.action') }}",
|
||||
method:'GET',
|
||||
data:{query:query},
|
||||
dataType:'json',
|
||||
success:function(data) {
|
||||
$('tbody').html(data.table_data);
|
||||
$('#total_records').text(data.total_data);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function(){
|
||||
|
||||
fetch_user_data();
|
||||
})
|
||||
|
||||
$(document).on('keyup', '#search', function() {
|
||||
var query = $(this).val();
|
||||
fetch_user_data(query);
|
||||
fetch_customer_data();
|
||||
|
||||
function fetch_customer_data(query = '')
|
||||
{
|
||||
$.ajax({
|
||||
url:"{{ route('live_search.action') }}",
|
||||
method:'GET',
|
||||
data:{query:query},
|
||||
dataType:'json',
|
||||
success:function(data)
|
||||
{
|
||||
$('tbody').html(data.table_data);
|
||||
$('#total_records').text(data.total_data);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$(document).on('keyup', '#search', function(){
|
||||
var query = $(this).val();
|
||||
fetch_customer_data(query);
|
||||
});
|
||||
|
||||
</script>
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user