So to custumize this I have one way for solving this problem. The way is just to create your own script to make this conditions just see this example below..
<?php echo CHtml::checkBox("load_ajax",false,array('id'=>'load_risk_all'));echo "Load All Risk Child"; $url=CController::createUrl('project/vieweach',array('project_id'=>$model->project_id)); Yii::app()->clientScript->registerScript("check", '$("#load_risk_all").change(function(){ if($(this).is(":checked")){ $("#load_risk").load("'.$url.'"); $("#load_risk").fadeIn(); }else{ $("#load_risk").html(""); } }) ', CClientScript::POS_READY); ?> <div id="load_risk"> </div>And then you have to make sure for using partialRender for the content in your controller. You can also to customize your code of load() function in jQuery for loading the ajax content using $.ajax functions with the data you want.
$this->renderPartial('/risk/view_each',array('provider'=>$provider),false,true);
You can also use onChange event in checkbox htmlOption for supporting your own javascript model like this
<?php echo CHtml::checkbox("load risk",false,array("onChange"=>"js:yourcustomfunction()")); ?> //don't forget to register your own function in script tagThen nice use this..
No comments:
Post a Comment