I am triggering an ajax-enabled button on a type however Drupal’s setting
$form_state['#triggering_element'] to the fallacious ingredient.
The button is a toddler of a
#tree and is similar to different buttons in different tree-ed constructions, aside from its mother and father. However I assumed this was the purpose of
Trying on the drupal code in
type.inc it is clear that Drupal solely goes on the
#title property to determine the triggering ingredient, which is mechanically set to
'op' for buttons. This appears to don’t know about bushes or the ingredient’s mother and father.
The somewhat scant and really outdated docs for tree state:
#mother and fatheris used to create the title/ID of the shape ingredient itself.
However my button ingredient’s names aren’t being set to something apart from ‘op’. I am creating the buttons in a
#course of perform for the mother or father ingredient.
$type['group1'] = [ '#prefix' => '<div>group1', '#suffix' => '</div>', '#tree' => TRUE, 'trig' => [ '#type' => 'submit', '#value' => 'ajax go', '#ajax' => [ 'callback' => 'mymod_ajax_callback', 'wrapper' => 'foo', ], // Different components a part of group 1... ], $type['group2'] = // The identical.
A piece-around is to code creating distinctive names for each certainly one of these components, however I really feel I may be lacking a trick/nuance?