TbExtendedGridView

Общие вопросы по использованию фреймворка. Если не знаете как что-то сделать и это про Yii, вам сюда.
Ответить
rrepzy
Сообщения: 7
Зарегистрирован: 2014.06.03, 22:00

TbExtendedGridView

Сообщение rrepzy »

Делаю Drag'n'Drop с помощью YiiBooster.
Код виджета брал тут.
Вот что я зделал:
S:\home\example\www\protected\views\post\admin:

Код: Выделить всё

<?php
/* @var $this PostController */
/* @var $model Post */

<h1>Manage Posts</h1>

<p>
You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
    'model'=>$model,
)); 
</div><!-- search-form -->

    $this->widget('booster.widgets.TbExtendedGridView', array(
    'sortableRows'=>true,
    'afterSortableUpdate' => 'js:function(id, position){ console.log("id: "+id+", position:"+position);}',
    'type'=>'striped bordered',
    'dataProvider' => $model->search(),
    'template' => "{items}",
    'columns'=>array(
        'id',
        'title',
        'content',
        'tags',
        'status',
        'create_time',
        'update_time',
        'author_id',
        array(
            'class'=>'CButtonColumn',
        ),
    ), 
));
 ?>
Открываю http://example/index.php?r=post/admin и вижу вот такую штуку:

Manage Posts

You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.

Advanced Search 
Parse error: syntax error, unexpected '[' in S:\home\example\www\protected\extensions\booster\widgets\TbExtendedGridView.php on line 495

Что мне делать?
Аватара пользователя
kosenka
Сообщения: 677
Зарегистрирован: 2009.09.26, 12:41
Откуда: москва
Контактная информация:

Re: TbExtendedGridView

Сообщение kosenka »

Открыть файл S:\home\example\www\protected\extensions\booster\widgets\TbExtendedGridView.php в редакторе, перейти на строку 495 и посмотреть, где там "неожиданный [".
rrepzy
Сообщения: 7
Зарегистрирован: 2014.06.03, 22:00

Re: TbExtendedGridView

Сообщение rrepzy »

Открыл, посмотрел на код, вот фрагмент с 495 по 517

Код: Выделить всё

$xAxisData = [];
        
        $xAxisData[] = array('categories'=>array());
        if(!empty($this->chartOptions['data']['xAxis'])){
            $xAxis = $this->chartOptions['data']['xAxis'];
            $categories = $xAxis['categories'];
            if(is_array($categories)) {
                $xAxisData['categories'] = $categories;
            } else { // field name
                for ($row = 0; $row < $count; ++$row) {
                    $column = $this->getColumnByName($categories);
                    if (!is_null($column) && $column->value !== null) {
                        $xAxisData['categories'][] = $this->evaluateExpression(
                                $column->value,
                                array('data' => $data[$row], 'row' => $row)
                        );
                    } else {
                        $value = CHtml::value($data[$row], $categories);
                        $xAxisData['categories'][] = $value;
                    }
                }
            }
        }
 
Ответить