Hi gentlemen...
I want to manage (apply buzz.js) selected row by using add action, but I found its hard to apply my code.
main.php (application\controllers)
public function arrival()
{
$crud = new grocery_CRUD();
$crud->set_table('arrival');
$crud->columns('origin','airline','flight','schedarrival','actualarrival','termgate','status');
$crud->fields('origin','airline','flight','schedarrival','actualarrival','termgate','status');
$crud->display_as('actualarrival','Actual Arrival');
$crud->display_as('schedarrival','Scheduled Arrival');
$crud->display_as('termgate','Gate');
$crud->set_relation('origin','airport','city');
$crud->set_relation('airline','airlines','alname');
$crud->set_relation('status','statuss','sname');
$crud->add_action('Announce', '', 'main/announce','play-icon'); //here
$output = $crud->render();
$this->_example_output($output);
}
function announce($id){
$crud = new grocery_CRUD();
$crud->set_table('arrival');
$crud->columns('origin','flight','status');
$crud->where('id',$id);
$data = $crud->render();
$this->load->view('arrival_view.php',$data);
}
arrival_view.php (application\views)
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
</head>
<body>
<?php
echo $output;
?>
</body>
</html>
The code works but I cannot get specific values (origin, flight & status) from the $output because the view can only show table result.
I had try make another page contain:
- echo $output['flight'], it gave error: Illegal string offset
- echo $output->flight, it gave error: Trying to get property of non-object
Is there a way to pass the values to the view page smoothly without having a table?
Feel free to change my approach...
Thank you in advance