2

我是codeigniter的新手,我是简单的datagrid,只有几列......我想要从网格中得到的是......我需要从网格中获取检查值,......所以我不知道如何使用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();
4

1 回答 1

2

PHP 最适合处理服务器代码,但您正在寻找的往往是客户端分析。我建议您改为通过 javascript/jquery 进行此类检查。

离开/处理这个each(function(){...});

var check=$('chkboxId').attr('checked').value;
于 2012-11-05T03:34:03.430 回答