<?php echo CHtml::checkBox('markComplete', FALSE ,
array(
'class' => 'markComplete',
'id'=> 'markComplete'.$events['id'],
'ajax' => array(
'url'=>$this->createUrl('/events/events/MarkComplete'),
'data'=>'event_status_on='.$events['id'],
'type'=>'POST',
'beforeSend' => 'js:function(){
var idSelector = $("#markComplete'.$events['id'].'");
var check = idSelector.is(":checked");
var child = idSelector.parent("td");
var parent = $(child).parent("TR");
$(parent).css("opacity","0.5");
}',
'success'=>'js:function(resp) {
$("#right").prepend(resp);
return true;
}'
),
)
);
?>
Chtml CheckBox 单击复选框,但仍标记为未选中未更改..如果我将其更改为 TRUE,则它不会更改为 FALSE ...通过 AJAX 提交...完美响应。