如何取消选择jquery-select2单曲

时间:2016-06-17 10:15:37

标签: jquery-select2-4

我想要一个选择列表,可以选择取消选择的值。

<label for="ticket_status" class="control-label">Ticket Status:</label>
                    <select class="js-basic-ticket-status">
                    </select>

ticket_status = [{"id":"Cancelled","text":"Cancelled"},{"id":"Closed","text":"Closed"},{"id":"Completed","text":"Completed"},{"id":"Draft","text":"Draft"},{"id":"Implementation In Progress","text":"Implementation In Progress"},{"id":"Planning In Progress","text":"Planning In Progress"},{"id":"Rejected","text":"Rejected"},{"id":"Request For Change","text":"Request For Change"},{"id":"Scheduled","text":"Scheduled"},{"id":"Scheduled For Approval","text":"Scheduled For Approval"},{"id":"Scheduled For Review","text":"Scheduled For Review"}];
$(".js-basic-ticket-status").select2({
                placeholder: "Select Status",
                /*initSelection: function(element, callback) {                   
                },*/
                allowClear: true,
                data: ticket_status,
                //multiple: true,
                closeOnSelect: false,
            });

我可以在右上角看到'x',但点击时没有任何反应。

0 个答案:

没有答案