From 3f6e18c8b5cfe79026a32845aca6ca9c76fa2d7b Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 18 Dec 2014 11:20:21 +0100 Subject: [PATCH] Now the children are shown again --- pandora_console/include/class/Tree.class.php | 2 +- .../include/javascript/tree/TreeController.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index adbee1c738..289ce15203 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -70,7 +70,7 @@ class Tree { // First filter by name and father $groups = db_get_all_rows_filter('tgrupo', $filter, - array('id_grupo', 'nombre'));html_debug_print($groups, true); + array('id_grupo', 'nombre')); if (empty($groups)) $groups = array(); diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 366e8c07de..eafd762475 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -151,7 +151,7 @@ TreeController = { .removeClass("leaf-closed") .removeClass("leaf-error") .addClass("leaf-loading"); - + $.ajax({ url: controller.ajaxURL, type: 'POST', @@ -170,9 +170,9 @@ TreeController = { success: function(data, textStatus, xhr) { if (data.success) { - if (typeof element.tree != 'undefined' && element.tree.length > 0) { + if (typeof data.tree != 'undefined' && data.tree.length > 0) { $node.addClass("leaf-open"); - + var $children = _processGroup($node, data.tree); $children.slideDown(); @@ -267,7 +267,6 @@ TreeController = { this.filter = data.filter; } - this.index = TreeController.controllers.push(this) - 1; this.load(); }, remove: function () { @@ -280,6 +279,8 @@ TreeController = { } } } + controller.index = TreeController.controllers.push(controller) - 1; + return controller; } }