var aoFilterArticleGroups = { handleSuccess:function(o) { this.processResult(o); }, handleFailure:function(o) { }, processResult:function(o) { result = o.responseText.parseJSON(); groups = result['all']; ids = result['ids']; for (i in ids) { if ( i != 'toJSONString'); { node = tree.getNodeByProperty( 'group_id', ids[i] ); if ( node ) { if ( node.labelStyle ) { node.labelStyle = 'ygtvlabelfiltered'; } } } } for (i in groups) { if ( i != 'toJSONString') { node = tree.getNodeByProperty( 'group_id', groups[i] ); if ( node ) { node.expand(); } } } tree.draw(); document.getElementById( 'loadingDiv' ).style.display = 'none'; document.getElementById( 'treeDiv' ).style.display = 'block'; }, startRequest:function() { if (document.getElementById( 'filter_by' ).value) { document.getElementById( 'treeDiv' ).style.display = 'none'; document.getElementById( 'loadingDiv' ).style.display = 'block'; tree.clearFilteredNodes(); YAHOO.util.Connect.asyncRequest( 'POST', '/ajax/ajax.php', aoFilterArticleGroupsCallback, "action=getFilteredArticleGroups&filter_by=" + document.getElementById( 'filter_by' ).value ); } } }; /* * Define the callback object for success and failure * handlers as well as object scope. */ var aoFilterArticleGroupsCallback = { success:aoFilterArticleGroups.handleSuccess, failure:aoFilterArticleGroups.handleFailure, scope: aoFilterArticleGroups };