codeigniter - 如何从codeigniter中的datagrid获取复选框选中的值

标签 codeigniter

我是 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/

相关文章:

php - Mysql错误: Duplicate entry '1-5' for key 'PRIMARY' on insert unsure of how

javascript - PHP foreach 循环上的 jQuery 切换

javascript - 如何更改特定按钮,而不使用 jquery 中的 `this` 命令

javascript - 为什么我的刷新验证码在 Firefox 中不起作用?

codeigniter - CodeIgniter 中站点的根路径

PHP + 代码点火器 : Bootstrap nav-link active for sub directory

PHP Codeigniter 上传类,使用特定模式重命名文件

php - { } codeigniter 模型/ View 中的大括号

php - CodeIgniter 2.1.0 session 问题

javascript - Codeigniter Ajax 发布 : Always Return Same Data