ajax_example_advanced_commands_restripe_num_rows

  1. drupal
    1. 8
    2. 7
Versions
8 – 7 ajax_example_advanced_commands_restripe_num_rows($form, $form_state)

'restripe' rows callback.

Rebuilds the table with the selected number of rows.

Code

examples/ajax_example/ajax_example_advanced.inc, line 381

<?php
function ajax_example_advanced_commands_restripe_num_rows($form, $form_state) {
  $num_rows = $form_state['values']['restripe_num_rows'];
  $output = "<table id='restripe_table' style='border: 1px solid black'>";
  for ($i = 1; $i <= $num_rows; $i++) {
    $output .= "<tr><td>Row $i</td></tr>";
  }
  $output .= "</table>";
  return $output;
}
?>