diff --git a/public/themes/default/scripts/fields.js b/public/themes/default/scripts/fields.js index a97234fc..f26f6f89 100644 --- a/public/themes/default/scripts/fields.js +++ b/public/themes/default/scripts/fields.js @@ -128,14 +128,19 @@ $(document).ready(function(){ }, buttons: { Valider: function() { - alert('ok'); - alert($('.jstree').get_checked ( null, true)); + var key = $('div.jstree').attr('id'); + var elements = []; + $('#'+key).jstree("get_checked").each(function(){ + elements.push(this.id); + }); + set(key, elements.join(",")); + $(this).dialog('close'); }, - Annuler: function() { $(this).dialog('close'); } + Fermer: function() { $(this).dialog('close'); } }, - close: function() { $('#dialognaf').remove(); } + close: function() { $('#dialogtree').remove(); } }; - $('
').dialog(dialogOpts); + $('').dialog(dialogOpts); return false; });