Advanced field type in create mode
Hi I need to change field: chantier_id from simple int field to dropdown with the what will have the value=chantier_id and relation with chantiers model, where i have id field and will be shown the text = chantier's name.
Although I don't want change field name and buttons `add` and `edit` don't must appers like it's doing using:
public $foreign_keys = array('chantier_id' => array(FUEL_FOLDER => 'fuel_chantiers_model', 'order' => 'id desc') );
Screen:
http://puu.sh/aFs4o/54ba8c62b2.pngCan you help me with this issue, please.
Comments
Fuel_chantiers_model has: id, name, description, address, active - fields
Fuel_levels_model has: id, name, rank, map, chantier_id, active - fields
When I'm creating new item in levels module I need that chantier_id field was dropdown field with names fields from Fuel_chantiers_model and returning id in the end.
I'm using this functionality to implement this: public $foreign_keys = array('chantier_id' => array(FUEL_FOLDER => 'fuel_chantiers_model', 'order' => 'id desc') );
And what I have in the end is : http://puu.sh/aGKzK/db0d08b748.png.
So I don't need to change chantier_id field to Fuel chantier as you can see on the screen, and also there appears buttons to add or to edit chosen chantier item, what I also don't need. If there any abilities to customize this change field name to chantier_id and remove those buttons ( http://puu.sh/aGKL5/7666f94b68.png ) ?
... $fields['chantier_id']['label'] = 'Chantier'; $fields['chantier_id']['module'] = NULL; ...