Select2 start with input field instead of dropdown

前端 未结 11 891
太阳男子
太阳男子 2020-12-08 06:44

I use the js library select2. This is a screenshot of what I have now:
Start:
\"enter

11条回答
  •  既然无缘
    2020-12-08 07:29

    Matt,)

    this work

        $('.search-town-flat').select2({
            multiple: true,
            placeholder: "Enter values",
            allowClear: true,
            maximumSelectionLength: 2,
            theme      : "classic"
        }).on('select2:select', function (e) {
            $(this).val([]).trigger('change');
            $(this).val([e.params.data.id]).trigger("change");
        });
    

提交回复
热议问题