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

时间:2012-11-05 03:28:41

标签: 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();

1 个答案:

答案 0 :(得分:2)

PHP最适合处理服务器代码,但您正在寻找的往往是客户端分析。我建议你用javascript / jquery来做这种检查。

each(function(){...});

中保留/处理此内容
var check=$('chkboxId').attr('checked').value;