【问题标题】:How to show the pager down the List on Yii with Bootstrap ClistView如何使用 Bootstrap ClistView 在 Yii 上的列表中显示寻呼机
【发布时间】:2013-08-22 14:32:39
【问题描述】:

我想在索引页面列表中显示寻呼机...我在我的应用程序中使用引导程序作为主题

这是我的代码

 <?php $this->widget('zii.widgets.CListView', array(
       'dataProvider'=>$dataProvider,  
       'itemView'=>'_view',
       'template'=>'{items}',

)); ?>

【问题讨论】:

    标签: php twitter-bootstrap yii frameworks


    【解决方案1】:

    取决于您的数据提供者设置

    $dataProvider = new CActiveDataProvider('YourModelName', array(
                'pagination' => array(
                    'pageSize' => 5,
                ),
            ));
    

    并将寻呼机表达式添加到模板中

    $this->widget('zii.widgets.CListView', array(
           'dataProvider'=>$dataProvider,  
           'itemView'=>'_view',
           'template'=>'{items}<br/>{pager}'
    ));
    

    更新:

    $this->widget('zii.widgets.CListView', array(
        'dataProvider'=>$dataProvider,
        'itemView'=>'_view',
        'template'=>'<div class="bs-docs-example"><div id="yw121" class="grid-view"><table class="items table table-striped table-bordered table-condensed">{items}</table></div></div><br/>{pager}'
    ));
    

    【讨论】:

    • 它不断检查项目...默认情况下,当您不包含模板部分时 Yii 将其放下...但引导视图将其强制到顶部...
    • 我猜你把 listview 放在 table 里面,pager 会生成一个 div 使 table 格式无效,然后 pager 位置到顶部。我已经更新了我的答案,这是一个如何将您的表结构与寻呼机表达式分开的想法
    • 是的..我认为这可能是原因...让我试试你的建议
    • 感谢我刚刚工作,但我丢失了 column2 部分...我没有看到操作部分
    猜你喜欢
    • 2012-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多