0

我是新手,我已经下载了 Yii-Booster Widgets 以使用 TBRelationalColumn。

我已经从 yiibooster.clevertech.biz yiibooster-4.0.1.zip 文件下载了扩展并在

protected/extensions/booster

配置protected/config/local.php和main.php

  <?php
    Yii::setPathOfAlias('booster', dirname(__FILE__).'/../extensions/booster');
    Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');   
    return array(
        'components'=>array(
            'db' => array(              
            ),
                'mongodb' => array(
            'class'            => 'EMongoDB',         
          ),
           'booster'=>array(
                'class'=>'booster.components.Booster',
                'coreCss' => true,
                'responsiveCss' => true,
                'yiiCss' => true,

            ),
            'bootstrap'=>array(             
               'class'=>'bootstrap.components.bootstrap',
                'coreCss' => true,
                'responsiveCss' => true,
                'yiiCss' => true,
            ),

            'cache'=>array(
                'class' => 'CFileCache',
            ),
        ),
    );

当我使用这个小部件时,我得到了网格结构,但 js 没有启用 index.php

$this->widget('booster.widgets.TbExtendedGridView', array(
        'id' => 'invite-grid',
        'type' => 'striped condensed',
        'dataProvider' => $arrayDataProvider,      
        'columns' => array(
            'id',
            'username',
            'email',
            array(
                'class' => 'booster.widgets.TbRelationalColumn',
                'name' => 'test',
                'value' => '"grid"',
                'url' => $this->createUrl('site/relational'),
                'afterAjaxUpdate' => 'js:function(tr,rowid,data){
bootbox.alert("I have afterAjax events too!<br/>This will only happen once for row with id: "+rowid);
}'
            ),                        
            )
    ));

单击网格时,我无法收到警报消息。请任何人帮我解决这个问题

4

1 回答 1

0

你没有加载它。如果您在所有页面上使用 boostrap,请从配置中预加载它,

return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'My Site',

    'preload'=>array(
        'log',
        'bootstrap', //preload bootsrtap
        ),

否则,您可以使用过滤器为每个控制器单独添加它

public function filters()
    {
        return array(
            'accessControl', 
            array('ext.booster.filters.BootstrapFilter') //load bootstrap
        );
于 2014-09-23T15:51:12.513 回答