You are here

function views_megarow_command_refresh_parent in Views Megarow 7

Refresh the parent row of a megarow.

Parameters

$entity_id: The unique id of the base table entity being displayed whose data needs to be refreshed.

$display_id: The display_id of the view where the refresh target is displayed.

$args: An array of arguments the view needs to function.

File

./views_megarow.module, line 370

Code

function views_megarow_command_refresh_parent($entity_id, $display_id, $args = array()) {
  drupal_add_js(array(
    'ViewsMegarow' => array(
      'display_id' => $display_id,
    ),
  ), 'setting');

  // If no arguments are passed, default to the entity_id
  if (empty($args)) {
    $args = array(
      $entity_id,
    );
  }
  drupal_add_js(array(
    'ViewsMegarow' => array(
      'args' => drupal_json_encode($args),
    ),
  ), 'setting');
  return array(
    'command' => 'megarow_refresh_parent',
    'entity_id' => $entity_id,
  );
}