kalyon
            (Hkalyoncu)
          
          
          
              
              
          1
          
         
        
          hello
i want to add a javascript effect to a widget (like the userlogin widget from blog demo).
it will be link initially when a click happens it will transform to full view widget.
im looking through docs but i couldnt see anything related so far. is there anything in
the framework for this kind of stuff? or do i have to hardcode it in the views
         
        
          
        
           
           
           
         
         
            
            
          
       
      
        
          
          
            Yeti
            (Chris)
          
          
          
              
              
          2
          
         
        
          We have done something similar. Our "Rollup" widget has a button to show/hide the content of the widget, so saving screen space.
Our solution was to register the script file in the init() method of our widget; keeps it out of the way and everything else nice and clean.
// Portlet extends CWidget
class Rollup extends Portlet {
  public function init() {
    $this->cssClass .= ' rollup';
    Yii::app()->clientScript->registerScriptFile('/js/rollup.js');
  }
}
Hope that helps.
Chris
         
        
        
           
           
           
         
         
            
            
          
       
      
        
          
          
            kalyon
            (Hkalyoncu)
          
          
          
              
              
          3
          
         
        
          thank you chris
it solved the problem. but im still thinking a class for basic widget effects.
since component class has event and behavior support.