我是 codeigniter 的新手,我是带有几列的简单数据网格...我想要从网格中得到的是...我需要从网格中获取检查值,...所以我不知道如何使用 foreach 循环和获取值..
谁能用例子解释一下我......
foreach ($persons as $person)
{
$this->table->add_row(form_checkbox('att',$person->tab_classid), $person->tab_classid, $person->tab_classtitle, date('d-m-Y H:i',strtotime($person->tab_classtime)),$person->tab_pemail,anchor($person->tab_prsturl,'view','target="_new"'),anchor($person->tab_recurl,'view','target="_new"'),$person->tab_classduration,$person->tab_crtdate,
anchor('person/view/'.$person->tab_classid,'view',array('class'=>'view')).' '.
anchor('person/update/'.$person->tab_classid,'update',array('class'=>'update')).' '.
anchor('person/test/'.$person->tab_classid,'Attendee',array('class'=>'attendee')).' '.
anchor('person/delete/'.$person->tab_classid,'delete',array('class'=>'delete','onclick'=>"return confirm('Are you sure want to delete this person?')"))
);
}
$data['table'] = $this->table->generate();
最佳答案
PHP 最适合处理服务器代码,但您正在寻找的往往是客户端分析。我建议您改为通过 javascript/jquery 进行此类检查。
将其保留/处理在 each(function(){...});
var check=$('chkboxId').attr('checked').value;
关于codeigniter - 如何从codeigniter中的datagrid获取复选框选中的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13225556/