ecnuzhangsq 2011-12-01 15:37:10 2851次浏览 3条回复 0 0 0

[attach]508[/attach] 像是这种Portlet,可以添加最大最小按钮吗? 在Api中看到一句 [attach]509[/attach] 但是不知道具体怎么写,想请教大家!:P

  • 回复于 2011-12-01 20:17 举报
    protected function  renderDecoration() {
        if($this->title!==null)
        {
            echo "<div class=\"{$this->decorationCssClass}\">\n";
            echo "<div class=\"{$this->titleCssClass}\">";
            echo CHtml::link('收缩','#',array('class'=>'opt','style'=>'float:right'));
            echo $this->title;
            echo "</div>\n";
            echo "</div>\n";
        }
    
        Yii::app()->getClientScript()->registerScript("opt",<<<EOS
            $('.opt').toggle(function(){
                $(this).parent().parent().next().hide();
                $(this).text('打开');
        },function(){
            $(this).parent().parent().next().show();
            $(this).text('收缩');
    });
    return false;
    EOS
    );
    

    这是重写的 renderDecoration

  • 回复于 2011-12-02 08:55 举报

    感谢指点,谢谢了..

  • 回复于 2011-12-02 16:52 举报

    感激不尽, 我试了一下, very 好用~

您需要登录后才可以回复。登录 | 立即注册