Issue #207 new

Incorrect display information in TbGridView

Vasya Pupkin
created an issue

When a message is added to the database, then do a redirect to the home page and then, if you press on the paginator, it displays a blank area of the layout and incorrect paginator's. The second time clicking on paginator, resumes and layout in the correct state.

Картинка

If you press F5 or refresh the page, then the paginator and data tables are displayed and work. 1

public function actionAdd()
    {
        $model = new PostForm();

        $this->performAjaxValidation($model);

        if(isset($_POST['PostForm']))
        {
            $model->attributes = $_POST['PostForm'];

            $model->title     = "Заголовок";
            $model->date      = new CDbExpression('NOW()');
            $model->client_ip = ip2long(Yii::app()->request->userHostAddress);
            $model->user_id   = '1';

            if($model->save())
            {
                Yii::app()->user->setFlash('success',"<strong>Успешно!</strong>");
            }
            else
            {
                Yii::app()->user->setFlash('error',"<strong>Ошибка!</strong>");
            }
            $this->redirect(Yii::app()->homeUrl);
        }
        $this->render('/site/add',array('model' => $model));
    } 
<?php
/* @var $this SiteController */

$this->widget('bootstrap.widgets.TbGridView',array('type'         => 'striped',
                                                   'dataProvider' => $dataProvider,
                                                   'template'     => "{summary}{items}\n{pager}",
                                                   'columns'      => array(array('name'   => 'date',
                                                                                 'header' => 'Дата',
                                                                                 'value'  => 'Yii::app()->dateFormatter->format("dd/MM HH:mm", $data->date);',),
                                                                           array('name'     => 'action_id',
                                                                                 'header'   => 'Действие',
                                                                                 'sortable' => FALSE,
                                                                                 'value'    => '$data->action->name'),
                                                                           array('name'     => 'object_id',
                                                                                 'header'   => 'Объект',
                                                                                 'sortable' => FALSE,
                                                                                 'value'    => '$data->object->name'),
                                                                           array('name'     => 'room',
                                                                                 'header'   => 'Комнат',
                                                                                 'sortable' => FALSE),
                                                                           array('name'     => 'city',
                                                                                 'header'   => 'Город',
                                                                                 'sortable' => FALSE),
                                                                           array('name'     => 'street',
                                                                                 'header'   => 'Улица',
                                                                                 'sortable' => FALSE),
                                                                           array('name'     => 'm2',
                                                                                 'header'   => 'M<sup>2</sup>',
                                                                                 'sortable' => FALSE),
                                                                           array('name'     => 'descr_post',
                                                                                 'header'   => 'Описание',
                                                                                 'sortable' => FALSE),
                                                                           array('name'     => 'phone',
                                                                                 'header'   => 'Телефон',
                                                                                 'sortable' => FALSE),
                                                                           array('name'     => 'cost',
                                                                                 'header'   => 'Цена <i>(руб.)</i>',
                                                                                 'sortable' => FALSE,
                                                                                 'value'    => 'Yii::app()->numberFormatter->formatDecimal($data->cost);',),
                                                       /*
                                                                   array('class'       => 'bootstrap.widgets.TbButtonColumn',
                                                                         'htmlOptions' => array('style' => 'width: 50px'),
                                                                         'visible'=>!Yii::app()->user->isGuest)
                                                    */)));

It's not good public

<li class=" active"><a href="/main/index">1</a></li> <li class=""><a href="/main/index?pages=2">2</a></li> <li class="next"><a href="/main/index?pages=2">&rarr;</a></li></ul></div><div class="keys" style="display:none" title="/"><span>10</span><span>9</span><span>8</span><span>7</span><span>6</span></div>

Good public:

<div class="pagination"><ul id="yw1" class="yiiPager"><li class="previous"><a href="/main/index?ajax=yw1">&larr;</a></li> <li class=""><a href="/main/index?ajax=yw1">1</a></li> <li class=" active"><a href="/main/index?pages=2&amp;ajax=yw1">2</a></li> <li class="next disabled"><a href="/main/index?pages=2&amp;ajax=yw1">&rarr;</a></li></ul></div><div class="keys" style="display:none" title="/main/index?pages=2&amp;ajax=yw1"><span>5</span><span>4</span><span>3</span><span>2</span><span>1</span></div>

Comments (5)

  1. Log in to comment