ajax attempt
This commit is contained in:
@@ -40,26 +40,29 @@
|
|||||||
</html>
|
</html>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch_user_data();
|
fetch_customer_data();
|
||||||
})
|
|
||||||
|
function fetch_customer_data(query = '')
|
||||||
$(document).on('keyup', '#search', function() {
|
{
|
||||||
var query = $(this).val();
|
$.ajax({
|
||||||
fetch_user_data(query);
|
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