list_items : add CSS class to column
Is it possible to add CSS classes (or even IDs) to the data returned by list_items (pretty much like you would do with form_fields) ? Say i want to add the class 'highlight' to the col1 of my 'projects' module... how would you do that? I tried adding the 'class' index to the rows of the $data array but all that does is adding another table column ...
ideas? Thankyou
Comments
function list_items($limit = NULL, $offset = 0, $col = 'id', $order = 'asc') { $data = parent::list_items($limit, $offset, $col, $order); foreach($data as $key =>$val) { $data[$key]['__field__'] = array( 'label' => array('class' => 'test', 'id'=>'label'.$val['id'] ) ); } return $data; }
This example would apply the CSS class of "test" to the parent <td> in the "label" field. It would also add the id of "label{key}".
http://www.getfuelcms.com/user_guide/libraries/data_table