如何传递该行的数据?
在cgridview中:
array(
'header'=>'Message',
'type'=>'raw',
'value' => 'CHtml::link(substr($data->comments, 0, 70)."...","#",array("data-toggle"=>"modal","data-target"=>"#message","data-id" => "$data->comments"))',)
在TbModal下
<script>
$(document).ready(function(){
var comments = $this.data('id');
$("#message").val(comments);
}
);
</script>
答案 0 :(得分:0)
将"data-id" => "$data->comments"
替换为"data-id" => \'$data->comments\'