};
$(input).crmSelect2({
- data: scope[attrs.crmOptions],
+ data: function () {
+ return { results: scope[attrs.crmOptions] };
+ },
createSearchChoice: function(term) {
return {id: term, text: term + ' (' + ts('new') + ')'};
},
scope.$evalAsync('_resetSelection()');
e.preventDefault();
});
-
- scope.$watch(attrs.crmOptions, function(value) {
- $(input).select2('data', scope[attrs.crmOptions]);
- $(input).select2('val', '');
- });
}
};
});
})
.then(function (data) {
delete caseTypes.values[caseType.id];
- $scope.$digest();
});
};
$scope.revertCaseType = function (caseType) {