【问题标题】:Filter not working in Bootstrap TB Grid View过滤器在 Bootstrap TB 网格视图中不起作用
【发布时间】:2014-04-02 05:19:10
【问题描述】:

我目前正在尝试在 Yii 中实现引导网格视图。此列表工作正常,但过滤器不起作用,

我的看法:

<?php 

$obj=$this->widget('bootstrap.widgets.TbExtendedGridView', array(
    'dataProvider'=>$dataProvider,
    'type' => 'striped bordered',
    'filter'          => $model,
    'columns'=>array(

                array(            // display 'create_time' using an expression
                            'name'=>'host_name',
             'value'=>'$data->host_name',
                ),
                array(
                            'name'=>'host_serviceid',
                            'value'=>'$data->host_serviceid',
                ),
                                array(
                            'name'=>'status',
                            'value'=>'$data->status',
                ),
                array(
                                    'class'=>'CButtonColumn',
                                    'template'=>'{edit_date}{update}{delete}',
                                    'htmlOptions'=>array('width'=>'95px'),
                                    'buttons' => array(
                                           'edit_date' => array( //the name {reply} must be same
                                             'label' => 'Add Date', // text label of the button
                                               'url' => 'Yii::app()->createAbsoluteUrl("NimsoftHostsDetails/View", array("id"=>$data->host_id))', 
                                                  'imageUrl' => Yii::app()->baseUrl.'/images/icons/pencil.png',  // image URL of the button. If not set or false, a text link is used, The image must be 16X16 pixels

                                               ),
                                           ),)

                ),

)); 

?>

提前感谢您的帮助。

【问题讨论】:

    标签: twitter-bootstrap yii yii-extensions


    【解决方案1】:

    检查你的控制器...

    $model = new YourModel('search');
    $model->unsetAttributes(); // clear any default values
    
    if (isset($_GET['YourModel'])) {
        $model->attributes = $_GET['YourModel'];
    }
    

    检查YourModel“函数搜索()”

    在“规则”中检查 YourModel 的“搜索安全”字段

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-17
      • 1970-01-01
      • 1970-01-01
      • 2017-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多