|
|
@ -79,14 +79,14 @@ |
|
|
var displayName = $(this).data("autocompleteDisplayProperty"); |
|
|
var displayName = $(this).data("autocompleteDisplayProperty"); |
|
|
var displayValue = $(this).data("autocompleteValueProperty"); |
|
|
var displayValue = $(this).data("autocompleteValueProperty"); |
|
|
var itemsPropertyName = $(this).data("autocompleteItemsProperty"); |
|
|
var itemsPropertyName = $(this).data("autocompleteItemsProperty"); |
|
|
|
|
|
var filterParamName = $(this).data("autocompleteFilterParamName"); |
|
|
$select.select2({ |
|
|
$select.select2({ |
|
|
ajax: { |
|
|
ajax: { |
|
|
url: url, |
|
|
url: url, |
|
|
dataType: "json", |
|
|
dataType: "json", |
|
|
data: function (params) { |
|
|
data: function (params) { |
|
|
var query = { |
|
|
var query = {}; |
|
|
search: params.term |
|
|
query[filterParamName] = params.term; |
|
|
}; |
|
|
|
|
|
return query; |
|
|
return query; |
|
|
}, |
|
|
}, |
|
|
processResults: function (data) { |
|
|
processResults: function (data) { |
|
|
@ -95,7 +95,7 @@ |
|
|
if (itemsPropertyName) { |
|
|
if (itemsPropertyName) { |
|
|
items = data[itemsPropertyName]; |
|
|
items = data[itemsPropertyName]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
items.forEach(function (item, index) { |
|
|
items.forEach(function (item, index) { |
|
|
retVal.push({ |
|
|
retVal.push({ |
|
|
id: item[displayValue], |
|
|
id: item[displayValue], |
|
|
|