Now the children are shown again

This commit is contained in:
Alejandro Gallardo Escobar 2014-12-18 11:20:21 +01:00
parent cd560178c0
commit 96f6659b34
2 changed files with 6 additions and 5 deletions

View File

@ -70,7 +70,7 @@ class Tree {
// First filter by name and father // First filter by name and father
$groups = db_get_all_rows_filter('tgrupo', $groups = db_get_all_rows_filter('tgrupo',
$filter, $filter,
array('id_grupo', 'nombre'));html_debug_print($groups, true); array('id_grupo', 'nombre'));
if (empty($groups)) if (empty($groups))
$groups = array(); $groups = array();

View File

@ -151,7 +151,7 @@ TreeController = {
.removeClass("leaf-closed") .removeClass("leaf-closed")
.removeClass("leaf-error") .removeClass("leaf-error")
.addClass("leaf-loading"); .addClass("leaf-loading");
$.ajax({ $.ajax({
url: controller.ajaxURL, url: controller.ajaxURL,
type: 'POST', type: 'POST',
@ -170,9 +170,9 @@ TreeController = {
success: function(data, textStatus, xhr) { success: function(data, textStatus, xhr) {
if (data.success) { 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"); $node.addClass("leaf-open");
var $children = _processGroup($node, data.tree); var $children = _processGroup($node, data.tree);
$children.slideDown(); $children.slideDown();
@ -267,7 +267,6 @@ TreeController = {
this.filter = data.filter; this.filter = data.filter;
} }
this.index = TreeController.controllers.push(this) - 1;
this.load(); this.load();
}, },
remove: function () { remove: function () {
@ -280,6 +279,8 @@ TreeController = {
} }
} }
} }
controller.index = TreeController.controllers.push(controller) - 1;
return controller; return controller;
} }
} }