2013-01-19 34 views
0

我是代码点火器中的新bie .i在我的视图页面的表格中显示了数据..在每一行中都有一个编辑按钮..我希望如果点击在编辑链接一个colorbox会弹出一个窗体,其中的形式是填充旧值,然后他能够更新它..我做了一切控制器和模型,但我不知道如何使用colorbox ..我访问他们的网站还,但我不明白的多..这是我在做什么 这里是用户添加数据在更新之前在Colorbox中获取旧值

form name and id is "form" 
echo form_open('employesController/addEmployes') 

     form_input();// 
     form_input();// 
     form_button() 
     form_close(); 

    this is the table where data is showing 
    <td><?php echo $row->emp_name ?></td> 

    <td><?php echo $row->description ?></td> 



<td> <a href = "employesController/editEmploye/<?php echo $row->emp_id ?>" id = "btn"> Edit 

我控制器

形式210

我的语气

 function getEditEmploye($id) 
{ 
    return $this->db->where('emp_id',$id)->get('employees')->row(); 
} 

,我为我的模态弹出jQuery函数将是这样的事情..

$(document).ready(function(){ 
$("#btn").click(function(){ 
var $form = $("#form"); 
$("#").colorbox({inline:true, href:$form}); 


}); 
    }); 

请告诉我,我该如何在表单中选择行值in Colorbox

回答

0

好的,Colorboxcodeigniter真的很好地一起工作。我已使用ColorboxCI中完成了多个项目。

Colorbox只会在iframe中加载一个url。例如

http://localhost/mycontroller/edit

没有颜色框,将在当前窗口中更改。如果您在实际链接中包含颜色框类,它应该在iframe中打开。

相关问题