我想在我的 select2 中 Hook 一个事件一旦它被清除。 select2 使用 allowClear: true
初始化。然而事件
$select.on('select2-removed', function(event) {
console.log(event);
});
使用清除按钮重置 select2 时不会触发。
最佳答案
select2 v4.0.3
$('#smartsearch').on('select2:unselecting', function (e) {
alert('You clicked on X');
});
关于javascript - 为什么 select2-removing 事件不会在带有 allowClear 的 select2 中触发?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24558101/