⚠ 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

[ANSWERED] How to add fancybox in Grocery Crud



ssfthurber

ssfthurber
  • profile picture
  • Member

Posted 12 June 2013 - 21:21 PM

hey colins,

i did something similar with colorbox [similar tool]. it works and may be helpful for ideas.

in the template:

 

replace the 1-line the php echo $output with these 2 lines:

 $output.='<script>$("a.crud-action").colorbox({iframe:true,width:"98%",height:"98%"}); </script> '; 

 echo $output; 

add the css and js you need at the end of the head section -- something like this:

<link rel="stylesheet" href="js/colorbox.css" /> 
<script src="//cdn.jsdelivr.net/colorbox/1.3.32/jquery.colorbox-min.js"></script>
 

my controller is like this:

 public function employees()
{
$crud = new grocery_CRUD();
$crud->set_table('employees');
$crud->add_action('Visit Steve Thurber', 'http://www.grocerycrud.com/assets/uploads/general/smiley.png' '', '', array($this,'visitSteveThurber'));
$this->load->view('template.php',$output);          
}
 
function visitSteveThurber($primary_key , $row)
{
}

ssfthurber

ssfthurber
  • profile picture
  • Member

Posted 12 June 2013 - 21:33 PM

typo -- should be

<link rel="stylesheet" href="css/colorbox.css" /> 


heri09

heri09
  • profile picture
  • Member

Posted 23 April 2016 - 15:10 PM

hi KaBaDaBrA,

thank for your triks. its work.

 

but, i have a problem with add form. button save/save and return/cancel not work on fancybox