我想插入此代码
if($transaction_user_define_fields->udf_type == 'Selectbox'){
echo '<i class="fa fa-list fa-lg text-primary pull-left" data-toggle="tooltip" data-placement="right" title="View option" onclick="viewUDFOPT('.$transaction_user_define_fields->tran_udf_col_id.')"></i>';
}
里面
$this->table->add_row()
但是我得到了一个错误。请帮助
答案 0 :(得分:0)
if($transaction_user_define_fields->udf_type == 'Selectbox'){
$this->table->add_row('<i class="fa fa-list fa-lg text-primary pull-left" data-toggle="tooltip" data-placement="right" title="View option" onclick="viewUDFOPT('.$transaction_user_define_fields->tran_udf_col_id.')"></i>');
}
这会使标签可以点击,如果你想让整个单元格可以点击,你必须在添加行中将它设置为一个参数 根据codeigniter文档
$cell = array('data' => 'Blue', 'class' => 'highlight', 'colspan' => 2);
$this->table->add_row($cell, 'Red', 'Green');
// generates
// <td class='highlight' colspan='2'>Blue</td><td>Red</td><td>Green</td>