我使用的是 3.5.1 版。我试过同时使用
enable: false
和
disable: true
但似乎都不起作用。这是我的代码片段。
var select2Node = $element[0].firstChild;
$(select2Node).select2({
data: choices,
// Suppress the search box.
minimumResultsForSearch: -1,
allowClear: false,
width: '200px',
disable: true,
formatSelection: function(object, container) {
return $filter('truncateAtFirstInput')(object.id);
}
});