I'd watch some YouTube videos on filling div's with AJAX content, a note, Ajax doesn't fill anything you get return data then javaScript is what actually fills the div in the browser. Also look at some examples on the w3c site.
Feb 10, 2016
10
Level 1
Update part of the view using AJAX
Hi,
I have a page that lists names from a database tables. My view displays all the names in a grid inside a section called "content".
@section('content')
Now, I added a search box and connected it to an AJAX function to get called on key up event.
The problem I'm having now is how to update the content section only NOT the whole view when I filter the query inside the controller.
Here is my Controller:
public function index($keyword = null){ if(!is_null($keyword)){ $customers = Customers::Filter($keyword)->paginate(10); } else{ $customers = Customers::get()->paginate(10); } $data['customers'] = $customers; return view('admin.customers.index', $data); }
Thanks
Please or to participate in this conversation.