我正在尝试使用搜索栏过滤品牌,但我不知道要过滤的ajax代码
控制器
groups=np.array([('Species1',''), ('Species2', 'Species3')], dtype=object)
ajax
$brands = (request()->session()->get('business.enable_brand') == 1) ? Brands::where('business_id', $business_id)
->pluck('name', 'id')
->prepend(__('lang_v1.all_brands'), 'all') : false;
查看
$(function () {
var minlength = 3;
$("#searchbrands").keyup(function () {
var that = this,
value = $(this).val();
if (value.length >= minlength ) {
if (searchRequest != null)
searchRequest.abort();
searchRequest = $.ajax({
});
}
});
});