Example #1
0
            <div class="col-sm-4 text-center">
                {summary}
            </div>
            <div class="col-sm-4 text-right">
                ' . WidgetPageSize::widget(['pjaxId' => 'advert-grid-pjax']) . '
            </div>
        </div>
        {items}
        <div class="row">
            <div class="col-sm-8">
                {pager}
            </div>
            <div class="col-sm-4 text-right" style="padding-top: 20px">
                ' . GridBulkActions::widget(['gridId' => 'user-grid']) . '
            </div>
        </div>', 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['class' => 'yii\\grid\\SerialColumn', 'options' => ['style' => 'width:10px']], ['attribute' => 'id', 'header' => '№', 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'content', 'format' => 'raw', 'contentOptions' => ['style' => 'text-align: left'], 'filterInputOptions' => ['class' => 'form-control input-sm']], ['class' => 'roman444uk\\yii\\grid\\AjaxUpdateColumn', 'attribute' => 'status', 'fieldType' => AjaxUpdateColumn::FIELD_TYPE_DROPDOWN, 'fieldOptions' => ['class' => 'form-control input-sm', 'items' => Advert::getTranslatedStatusList()], 'filter' => Advert::getTranslatedStatusList(), 'filterInputOptions' => ['class' => 'form-control input-sm'], 'updateUrl' => function ($model, $key, $index) {
    return Yii::$app->urlManager->createUrl(['advert/update', 'id' => $key]);
}, 'errorUpdate' => new JsExpression("function() {\n                alert('error updating');\n            }")], ['class' => 'roman444uk\\yii\\grid\\AjaxUpdateColumn', 'attribute' => 'category', 'fieldType' => AjaxUpdateColumn::FIELD_TYPE_DROPDOWN, 'fieldOptions' => ['class' => 'form-control input-sm', 'items' => Category::getDropdownList()], 'filter' => Category::getDropdownList(), 'filterInputOptions' => ['class' => 'form-control input-sm'], 'updateUrl' => function ($model, $key, $index) {
    return Yii::$app->urlManager->createUrl(['advert/update', 'id' => $key]);
}, 'errorUpdate' => new JsExpression("function() {\n                alert('error updating');\n            }")], ['attribute' => 'city_id', 'header' => 'Город', 'value' => function ($model, $key, $index) {
    return $model->cityName;
}, 'filter' => City::getList(), 'filterInputOptions' => ['class' => 'form-control input-sm'], 'format' => 'raw'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'created_at', 'header' => 'Добавлено', 'format' => 'datetime', 'filter' => City::getList(), 'filterInputOptions' => ['class' => 'form-control input-sm']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'updated_at', 'header' => 'Обновлено', 'format' => 'datetime', 'filter' => City::getList(), 'filterInputOptions' => ['class' => 'form-control input-sm']], ['class' => 'roman444uk\\yii\\grid\\StatusColumn', 'attribute' => 'published', 'filterInputOptions' => ['class' => 'form-control input-sm']], ['class' => 'roman444uk\\yii\\grid\\StatusColumn', 'attribute' => 'is_foreign', 'header' => 'Из сервиса', 'filter' => ['Да', 'Нет'], 'filterInputOptions' => ['class' => 'form-control input-sm']], ['class' => 'roman444uk\\yii\\grid\\ViewColumn', 'view' => '@backend/views/advert/_advert_grid_column', 'options' => ['style' => 'width:70px']], ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['style' => 'width:30px; text-align:center;'], 'buttons' => ['view' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span><br>', $url, ['title' => Yii::t('yii', 'View'), 'data-pjax' => 0, 'data-view' => $key]);
}, 'update' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-pencil"></span><br>', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => 0, 'data-update' => $key]);
}]]]]);
?>

<?php 
Pjax::end();
?>