summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/blocks
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-03-19 13:11:06 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2020-03-19 13:17:27 +0100
commit122eed1dbebe0231fc48ed2e47bfd507240e28dd (patch)
treed8df5aebceae73dad69abb5e9b4e5670ffef3d59 /ishtar_common/templates/blocks
parent6fe124bde74471cf7f6ea1b7619c4f55bf8a9601 (diff)
downloadIshtar-122eed1dbebe0231fc48ed2e47bfd507240e28dd.tar.bz2
Ishtar-122eed1dbebe0231fc48ed2e47bfd507240e28dd.zip
Autocomplete widget: option to display detail of the current item
Diffstat (limited to 'ishtar_common/templates/blocks')
-rw-r--r--ishtar_common/templates/blocks/JQueryAutocomplete.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/ishtar_common/templates/blocks/JQueryAutocomplete.js b/ishtar_common/templates/blocks/JQueryAutocomplete.js
index 47a5db80b..32351b312 100644
--- a/ishtar_common/templates/blocks/JQueryAutocomplete.js
+++ b/ishtar_common/templates/blocks/JQueryAutocomplete.js
@@ -47,6 +47,16 @@ $(function() {
$('#id_{{field_id}}').change(function(){
$("#id_select_{{field_id}}").attr('title', $('#id_select_{{field_id}}').val());
+ {% if detail %}
+ var current_val = $('#id_{{field_id}}').val();
+ if (current_val){
+ var detail_url = "{{detail}}" + current_val + "/";
+ $.get(detail_url, function(data) {
+ $("#id_{{field_id}}-detail").html(data);
+ });
+ }
+ {% endif %}
+
});
$('#id_{{field_id}}').change();