0
我如何允许动态搜索不仅仅是使用Laravel 5搜索第一页,而是全部搜索?在Laravel 5中使用分页支持进行动态搜索
的Jquery:
var $cells = $("tbody td");
$(".searchterm").keyup(function() {
var val = $.trim(this.value).toUpperCase();
if (val === "")
$cells.parent().show();
else {
$cells.parent().hide();
$cells.filter(function() {
return -1 != $(this).text().toUpperCase().indexOf(val); }).parent().show();
}
});
PHP:
public function index()
{
$ban = DB::table("bans")->select(['id', 'userid', 'banned_by', 'date_issued'])->orderBy("date_issued", "asc")->paginate(15);
return view("bans")->with('bans', $ban);
}
Web.php路线:
Route::get('bans', '[email protected]');
是的,但它又如何显示其他页面的结果,如页面2,页面3等? –
是否要使用与其他页面相同的方法,则需要更改 tr = $('#tbCustomer tbody tr');到tr = $(selector); –