From 5196da23299d851dfc69eed9c65ad464acfa8137 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 14 May 2012 08:25:05 +0000 Subject: [PATCH] Traitement des selectMultiple --- public/themes/default/scripts/fields.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/public/themes/default/scripts/fields.js b/public/themes/default/scripts/fields.js index 2a9b6bcf..b5bc2a37 100644 --- a/public/themes/default/scripts/fields.js +++ b/public/themes/default/scripts/fields.js @@ -52,11 +52,15 @@ $(document).ready(function() $('#tabs').delegate('a.selectMultiple', 'click', function(e){ - + e.stopPropagation(); + var obj = $(this).parent().find('select.criteres'); + set(obj.attr('name'), obj.val()); }); $('#tabs').delegate('a.selectMultipleEx', 'click', function(e){ - + e.stopPropagation(); + var obj = $(this).parent().find('select.criteres'); + set(obj.attr('name'), obj.val(), 1); }); $('#tabs').delegate('a.autocomplet', 'click', function(e){ @@ -145,13 +149,15 @@ $(document).ready(function() }); -function set(key, value) +function set(key, value, ex) { + ex = typeof ex !== 'undefined' ? ex : 0; + $('#comptage').css('display', 'none'); $('#attente').css('display', 'block'); $('#panel').html(''); - $.post('/comptage/index', { cle:key, valeur:value }, function(data, status) { + $.post('/comptage/index', { cle:key, valeur:value, exlcude:ex }, function(data, status) { var html = 'Nombre sélectionnées : ' + data.count + ' (dont ' + data.insee +' unité(s) insee)';