2015-02-09 16 views
0

我打開時,使用下面的代碼集bootbox對話框窗口的焦點通過選擇2開事件

$("#categoryfinder").on("select2-open", function() { 
    bootbox.confirm("Are you sure?", function (result) { 
     Example.show("Confirm result: " + result); 
    }); 
}); 

選擇2輸入框裏面的用戶點擊一旦開了一個bootbox對話框,彈出窗口不活躍,我必須點擊兩次關閉或觸發彈出式窗口上的任何事件

請讓我知道是否有任何解決方案。

編輯:當我點擊裏面1,彈出窗口在1,2,3沒有激活,我必須點擊一次,使其活動。

enter image description here

+0

你想它,所以如果用戶選擇「取消」,不開放,如果用戶選擇二下拉不開選擇「確定」? – 2015-02-10 00:31:29

+0

我不打開select2下拉列表。我有「dropdownCssClass:'noshow',」在config.when選項卡中的select2控件,它打開一個彈出窗口,它不是活動的 – C4CodeE4Exe 2015-02-10 15:43:29

回答

0

我用以下方法解決了這個問題,改變

$("#allergenfinder").on("select2-opening", function (e) { 
    e.preventDefault(); 
    excludeAllergenPrompt(); 

});