Jump to content


[ANSWERED] How to add fancybox in Grocery Crud

fancybox

  • Please log in to reply
22 replies to this topic

#21 ssfthurber

ssfthurber

    Member

  • Members
  • PipPip
  • 27 posts

Posted 12 June 2013 - 09: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.grocerycr...eral/smiley.png' '', '', array($this,'visitSteveThurber'));
$this->load->view('template.php',$output);          
}
 
function visitSteveThurber($primary_key , $row)
{
}


#22 ssfthurber

ssfthurber

    Member

  • Members
  • PipPip
  • 27 posts

Posted 12 June 2013 - 09:33 PM

typo -- should be

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



#23 heri09

heri09

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 23 April 2016 - 03: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







Also tagged with one or more of these keywords: fancybox

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users