Morning to all. I have a table with 10 columns for attachments .. I have used :
$crud->set_field_upload('fisier1','assets/uploads/atasamente'); $crud->set_field_upload('fisier2','assets/uploads/atasamente'); $crud->set_field_upload('fisier3','assets/uploads/atasamente'); . .
to set the path and field type. Now what i want to do is make in the view a dropdown with the name of the files users upload from where they can select a file and the file opens in a new window ( like when you click on it in - normal way ).
I have used
$crud->callback_column('continut',array($this,'getAttachments'));
to make a callback with a new column and the next function :
public function getAttachments($value, $row) { $attachments = array('' => '', '1' => $row->fisier1, '2' => $row->fisier2, '3' => $row->fisier3, '4' => $row->fisier4, '5' => $row->fisier5, ... ); $data = "<div style='width:230px'><div style='float:left'>".form_dropdown('', $attachments)."</div>"; return $data; }
I have the dropmenu with the files names and all but i cant figure a way how to open the file when i click on them or if this is the best way to do it.
If someone can point me in the right way ..
Thanks for your time