From cf50bc0374b7393e600676f1e40e347fb5baa2a9 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 18 Jan 2012 08:24:47 +0000 Subject: [PATCH] Javascript arborescence ok --- public/themes/default/scripts/fields.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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; });