⚠ In case you've missed it we are migrating to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠


Confirmation Message on add_action ( )


  • Please log in to reply
No replies to this topic

#1 dwdc

dwdc

    Member

  • Advanced Member
  • PipPip
  • 10 posts

Posted 13 August 2021 - 06:41 AM

I have a basic LIST where I am using add_action buttons to run some routines. All routines are working as expected ACCEPT when I delete a row, I want to display a javascript confirmation message alert( ). I am unable to figure out how to do this.

 

$crud->unset_delete();
            
            if($_SESSION['admin'] == 1) $crud->add_action('Edit', '', 'setlistsongs','ui-icon-pencil');
            if($_SESSION['admin'] == 1) $crud->add_action('Duplicate Set', '', 'dupesetlist','ui-icon-copy');
            if($_SESSION['admin'] == 1) $crud->add_action('Delete Set', '', 'deletesetlist','ui-icon-circle-minus');
            
            $output = $crud->render();
            
            $this->load->view('raw',(array)$output);

Here is the function:

public function deletesetlist($id){
   $this->load->model('admin_model');
   $this->admin_model->delete_set_list($id);
   redirect('setlist', 'refresh');
   return true;
}

Here is the MODEL function:

public function delete_set_list($id){
   $sql = 'DELETE FROM set_lists WHERE id = '.$id;
   $this->db->query($sql);
        
   $sql = 'DELETE FROM set_lists_songs WHERE setlist_id = '.$id;
   $this->db->query($sql);
}

I tried using the built in callback_after_delete ( ) function, which has the generic CONF message, but when it did the routine, the DATATABLES did not update and the delete row still showed in the list (NO REFRESH). So I do not know what worse...NO Confirmation Message or a dead row in the list.

Any insights and advice would be appreciated.

Don






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users