0
これは私と一緒に何度も起こったが、私はそれらのほとんどを修正するために管理しますが、ここで再び別の新しい問題:のYii:
チェックボックスリストを使用すると、ajax操作の後にselect allというチェックボックスがあります。このチェックボックスをオンにすると、他のすべてのチェックボックスが選択されなくなります。だから私はそれをリフレッシュするのですか?
<?php
$filterList = array(
'first' => 'first option',
'second' => 'second option',
'third' => 'third option',
);
$htmlOptions = array(
'checkAll'=>'Select All',
'separator' => ' ',
'template' => '{input} {label}<br/>'
// 'template' => '<tr><td >{label}</td><td>{input}</td></tr>'
);
echo CHtml::checkBoxList('filters', array('1'), $filterList, $htmlOptions)
?>
のjQuery
jQuery('#filters_all').click(function() {
jQuery("input[name='filters\[\]']").attr('checked', this.checked);
});
jQuery("input[name='filters\[\]']").click(function() {
jQuery('#filters_all').attr('checked', !jQuery("input[name='filters\[\]']:not(:checked)").length);
});
jQuery('#filters_all').attr('checked', !jQuery("input[name='filters\[\]']:not(:checked)").length);
私はあなたの仮定を理解していない原因私は、ウル関心に感謝を生成jqueryのコードを追加した、あなたが複数に基づいて詳しく説明することを願ってその編集 –