custom view in fuel cms admin (backend)

edited February 2015 in Modules
I have a simple module with name 'orders'. There is another simple module with name 'order details'. These two tables are linked using a foreign key i.e. order_id.
What I want is when I click the 'view' in orders module it should take me to a view where it would display order details corresponding to that order number in the admin view only.
It would also be okay if I send an ajax request and get the data
What is the best way to do this ?

Comments

  • edited 6:16AM
    If you don't need to create an order from the admin, you could do something like the following on your orders module config (in MY_fuel_modules.php):
    'table_actions' => array('DETAILS' => fuel_url('order_details/edit/{id}'), 'DELETE'), 'displayonly' => TRUE, 'item_actions' => array()
    Then, on your order_details module configuration, you can use the "displayonly" module property in your MY_fuel_modules.php config:
    'displayonly' => TRUE,
  • edited June 2017
    but it is showing the ids instead of the name value for example
    Job 1
    City 5583
    instead of
    job name and
    city name
    which i have related in $foreign_keys as
    public $foreign_keys = array('job_id'=>array('jobs'=>'jobs_model','where' => array('is_disabled' => 0)),
    'citi_id'=>array('cities'=>'cities_model','where' => array('is_disabled' => 0))
    );
    is their any fixes for it??
  • edited 6:16AM
    Instead of using displayonly, you can use overwrite the model's form_fields method and use a field type of "custom" which has a "value" parameter of what you want it to display.
Sign In or Register to comment.