⚠ 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

Where to edit the 'Edit' and 'Delete' button?



Sabrina Wand
  • profile picture
  • Member

Posted 21 November 2015 - 14:51 PM

Hi,

I have ion auth 2 installed together with grocerycrud.

 

1. I would like the edit and delete button to appear to admin only and user can only see the view button view
I got the follow code,if (!$this->ion_auth->in_group($admin)) {, where do i add to the edit and delete button?

 

2. Let say first name, last name , can I hyperlink the word , instead of click the view button, they click on the name also lead to the result page.

 


buoncri
  • profile picture
  • Member

Posted 24 November 2015 - 12:44 PM

1) can use :

unset_delete Remove the delete operation from the CRUD grid unset_edit Unsets the edit operation

 

2) use a callback to make what you want like in this example where i need to show the euro char ... you can substitute the <p> tag with <a href=" ....> </a>

     // Callbacks zone
     $crud->callback_column('Quota_indennita',array($this,'valueToEuro'));


    function valueToEuro($value, $row) {
        return '<p align="right"> &euro; ' . $value . '</p>';
    }