Yiii list bug

Please update like this because if some one don’t wont to use ajax update scripts are still rendered and can be buggy because i use custom scripts

This can be like this


if($this->ajaxUpdate != false){

$cs=Yii::app()->getClientScript();

$cs->registerCoreScript('jquery');

$cs->registerCoreScript('bbq');

$cs->registerScriptFile($this->baseScriptUrl.'/jquery.yiilistview.js',CClientScript::POS_END);

$cs->registerScript(__CLASS__.'#'.$id,"jQuery('#$id').yiiListView($options);");

}

Why not use clientscript to omit them,




Yii::app()->clientScript->scriptMap = array(

    'jquery.js'         => false,

    'jquery.yiilistview.js' => false,

    ....

);



Your idea is a bit forceful, What if I want to load a listview via ajax, none of the list view js would get loaded.

As you can see IF ajax is true than that script is renderend.

Yes i agree with you to use script map but sometimes you wont to use ajax in some part of website so why if you all ready set that property to false is script rendered…


if($this->ajaxUpdate){

$cs=Yii::app()->getClientScript();

$cs->registerCoreScript('jquery');

$cs->registerCoreScript('bbq');

$cs->registerScriptFile($this->baseScriptUrl.'/jquery.yiilistview.js',CClientScript::POS_END);

$cs->registerScript(__CLASS__.'#'.$id,"jQuery('#$id').yiiListView($options);");

}

No ajax means just that… that the refresh will not be made using ajax… it does not mean noJavaScript…