You are here

function term_reference_tree_children_callback in Taxonomy Term Reference Tree Widget 7

Ajax callback to load children for a list.

1 string reference to 'term_reference_tree_children_callback'
_term_reference_tree_build_level in ./term_reference_tree.widget.inc
Builds a level in the term reference tree widget.

File

./term_reference_tree.widget.inc, line 818

Code

function term_reference_tree_children_callback($form, $form_state) {
  $button = $form_state['triggering_element'];
  $element = drupal_array_get_nested_value($form, array_slice($button['#array_parents'], 0, -1));
  $commands[] = array(
    'command' => 'term_reference_tree_append_children',
    'data' => drupal_render($element),
  );
  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}