You are here

function ctools_ajax_sample_tablenix in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 ctools_ajax_sample/ctools_ajax_sample.module \ctools_ajax_sample_tablenix()

Nix a row from a table and restripe.

1 string reference to 'ctools_ajax_sample_tablenix'
ctools_ajax_sample_menu in ctools_ajax_sample/ctools_ajax_sample.module
Implementation of hook_menu()

File

ctools_ajax_sample/ctools_ajax_sample.module, line 240
Sample AJAX functionality so people can see some of the CTools AJAX features in use.

Code

function ctools_ajax_sample_tablenix($js, $row) {
  if (!$js) {

    // We don't support degrading this from js because we're not
    // using the server to remember the state of the table.
    return MENU_ACCESS_DENIED;
  }
  ctools_include('ajax');
  $commands = array();
  $commands[] = ajax_command_remove("tr.ajax-sample-row-{$row}");
  $commands[] = ajax_command_restripe("table.ajax-sample-table");
  print ajax_render($commands);
  exit;
}