Yii Framework Forum: registerScriptFile of Yii built-in widgets isn'tset CClientScript::POS_* - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

registerScriptFile of Yii built-in widgets isn'tset CClientScript::POS_* Rate Topic: -----

#1 User is offline   乔楚/HonestQiao 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 10-April 10

Posted 26 October 2010 - 09:50 PM

registerScriptFile in Yii built-in widgets isn't set CClientScript::POS_*

If you load your's jquery , and set:
<?php
Yii::app()->clientScript->coreScriptPosition = CClientScript::POS_BEGIN;
Yii::app()->clientScript->scriptMap=array('jquery.js'=>false,'jquery.min.js'=>false);
?>

then ,use CListView , or CJuiWidget, or CFlexWidget, or CGridView, will get a js error : jQuery not defined.


Solution:
1. wait for upgrade.
2. or ,you can do :
copy the widget class file to views/widgets, modify registerScriptFile line , and append CClientScript::POS_BEGIN.
in you script, code like : $this->widget('application.views.widgets.CListView'......);
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users