iivano71
(Igor Zg1987)
August 2, 2011, 7:32pm
1
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);");
}
alex-w
(Pr0j3ct A1ex)
August 3, 2011, 7:47am
2
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.
iivano71
(Igor Zg1987)
August 3, 2011, 8:20am
3
alex-w:
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);");
}
mdomba
(Maurizio Domba Cerin)
August 3, 2011, 9:31am
4
No ajax means just that… that the refresh will not be made using ajax… it does not mean noJavaScript…