我是新手,我已经下载了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是Not Enable 的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);
}'
),
)
));
点击网格时,我无法收到提醒消息。请任何人帮我解决这个问题
答案 0 :(得分:0)
您没有加载它。如果您在所有页面中使用引导程序,请从配置中预加载
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
);