|
|
|
|
@ -2,7 +2,49 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(function() { |
|
|
|
|
$('.-select2').select2() |
|
|
|
|
//$('.-select2').select2({
|
|
|
|
|
// language: 'ru',
|
|
|
|
|
//})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('.-select2').select2({ |
|
|
|
|
ajax: { |
|
|
|
|
url: "/api/specializations/", |
|
|
|
|
dataType: 'json', |
|
|
|
|
delay: 250, |
|
|
|
|
|
|
|
|
|
data: function(params) { |
|
|
|
|
return { |
|
|
|
|
'name__icontains': params.term, |
|
|
|
|
page: params.page, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
processResults: function(data, params) { |
|
|
|
|
params.page = params.page || 1 |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
results: _.map(function(item) { |
|
|
|
|
return { |
|
|
|
|
text: item.name, |
|
|
|
|
id: item.id, |
|
|
|
|
} |
|
|
|
|
}, data.results), |
|
|
|
|
|
|
|
|
|
pagination: { |
|
|
|
|
more: (params.page * 10) < data.count |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//cache: true
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//escapeMarkup: function(markup) {return markup}, // let our custom formatter work
|
|
|
|
|
minimumInputLength: 1, |
|
|
|
|
//templateResult: formatRepo, // omitted for brevity, see the source of this page
|
|
|
|
|
//templateSelection: formatRepoSelection // omitted for brevity, see the source of this page
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|