⚠ 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

unset_action only for one row ?



dontako
  • profile picture
  • Member

Posted 14 December 2012 - 17:30 PM

It's Possible (unset only one)??

(Not this way) /topic/689-disable-edit-and-delete-actions-for-specific-rows/

Thanks :)

dontako
  • profile picture
  • Member

Posted 14 December 2012 - 20:15 PM

I made it, editing list.php (flexigrid)

tlc033
  • profile picture
  • Member

Posted 15 December 2012 - 20:30 PM

Hi, dontako, can you expline how you made it ? THX.

dontako
  • profile picture
  • Member

Posted 18 December 2012 - 20:54 PM

[quote name='tlc033' timestamp='1355603444' post='4747']
Hi, dontako, can you expline how you made it ? THX.
[/quote]

Hello!! I did this:

First opened list.php file (located in "assets \ grocery_crud \ themes \ Flexigrid \ views")
Then, near line 37:

<div class='tools'>
<?php if(!$unset_delete){

// GET ITEM ID
$id = substr($row->delete_url,-1);
// GET METHOD NAME
$CI = &get_instance();
$method = $CI->router->method;

// Prevent hide content with the same ID in other methods.
if($method == 'admin' && $id != 5)
{
?>
<a href='<?php echo $row->delete_url?>' title='<?php echo $this->l('list_delete')?> <?php echo $subject?>' class="delete-row" >
<span class='delete-icon'></span>
</a>
<?php }
}?>



And Voilá

tlc033
  • profile picture
  • Member

Posted 18 December 2012 - 21:20 PM

THX.dontako.

victor
  • profile picture
  • Member

Posted 19 December 2012 - 09:40 AM

But user can go by url site.com/your_controller/your_function/delete/5 and this operation can delete this row.
You should to check it in the controller.

dontako
  • profile picture
  • Member

Posted 19 December 2012 - 13:51 PM

[quote name='victor' timestamp='1355910048' post='4800']
But user can go by url site.com/your_controller/your_function/delete/5 and this operation can delete this row.
You should to check it in the controller.
[/quote]

You're right ! mmm I'll check it later :)

jorocoimbra
  • profile picture
  • Member

Posted 13 March 2013 - 20:53 PM

hi! i have same problem, i want hide actions "edit" or "delete"  in some rows, depending of result of  a query.

 

I appreciate someone help me