You are here

function slickgrid_delete_form_submit in Slickgrid 7.2

Submit function for the deletion of entities.

File

includes/slickgrid.form.inc, line 206

Code

function slickgrid_delete_form_submit($form, &$form_state) {
  $commands = array();
  if ($form_state['values']['op'] == $form_state['values']['do']) {
    entity_delete_multiple($form_state['values']['entity_type'], $form_state['values']['entity_ids']);
    $commands[] = ajax_command_invoke('', 'slickgrid_messages', array(
      array(
        array(
          'type' => 'status',
          'message' => format_plural(count($form_state['values']['entity_ids']), t('Deleted the selected row'), t('Delete the @num selected rows', array(
            '@num' => count($form_state['values']['entity_ids']),
          ))),
        ),
      ),
    ));
    $commands[] = ajax_command_invoke('', 'slickgrid_refresh');
  }
  $commands[] = ajax_command_remove('#' . $form_state['values']['form_id'] . ' ~ div');
  $form_state['slickgrid_commands'] = $commands;
}