⚠ In case you've missed it, we have migrated 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 is an archived forum. ⚠

  •     

profile picture

Custom drop down field ?



luis1992

luis1992
  • profile picture
  • Member

Posted 04 December 2012 - 18:01 PM

Hi there, this is my first thread in the forum.
I searched quite a long time for same topics like this one, but I still cannot get the solution yet.

Here is my table structure:

staff
-------------------------
| staff_ID|Hi there, this is my first thread in the forum.
I searched quite a long time for same topics like this one, but I still cannot get the solution yet.

Here is my table structure:

staff
-------------------------
| staff_ID |
|position_ID |
---------------------------

staff_car
----------------------
| s_ID |
| c_ID |
----------------------

I try to set a custom drop down field by :
$result = $this->db->query("Select * from staff where Position_ID != 3");
foreach($result->result() as $row) :
$string= array($row->Staff_ID => $row->Staff_ID.' '.$row->Staff_FirstName.' '.$row->Staff_SurName);
$crud->field_type('S_ID','dropdown',$string);
endforeach;


The query on it own is fine and it returns the results I want. But in the CRUD field, it own shows up with the last record.
Therefore I wonder where is the problem? Why is it not show up as an array ?

And I also have a second question, I added an action, it appear with the custom icon, but there is no text next to it, so do edit and delect.
How can I slove this ?