Selectize - 如何在Laravel 4.2中进行多选搜索?

时间:2017-05-29 07:02:54

标签: php laravel select selectize.js laravel-4.2

我正在尝试从我的选择中选择多个值并在我的过滤器中搜索。我无法实现它。我在tec_id中遇到错误,其中代码如下。

Blade.php

{{ Form::select('tech_filter[]', array(''=> 'Loading...'), null, array('multiple' => 'multiple','id' => 'tech_filter', 'onchange' => 'getAjaxTechList(1)')) }}

脚本

function getAjaxTechList(page) {
            var tech_filter = $('#tech_filter').val();

            $.ajax({
                url: '/tech/ajax/get/tech?page=' + page + '&search_query=' + search_query               
                + '&tech_filter=' + tech_filter
            }).done(function (data) {
                $('#tech_list').html(data);
                $('#loader_tech_list').hide();
                $('#tech_list').show();
                $("#tech_list_table").tablesorter();
                $('.datepicker-webtics').datetimepicker({
                    timepicker: false,
                    format: 'Y-m-d',
                    lang: 'en'
                });
                $('#tech_list_list').foundation();
            });
        }

控制器

public function getAjaxTechList()
    {
        $tech_filter = array();      
        $tech_filter['tech_filter'] = Input::get('tech_filter');
        if($tech_filter != '') {
            $build_query->wherein('tec_id', $tech_filter);
        }
    }

0 个答案:

没有答案