<?php yii\widgets\Pjax::begin();?>
// Здесь форма с фильтром
// Здесь ListView
<?php yii\widgets\Pjax::end(); ?>
$is_stap_ajax=StringHelper::startsWith($this->action->id, 'step') && Yii::$app->request->isAjax;
return $is_stap_ajax ? $this->renderPartial($view, $params) : $this->render($view, $params);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort'=> [
'attributes' => [
'age',
'name' => [
'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC],
'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC],
'default' => SORT_DESC,
'label' => 'Name',
],
],
]);
$countries = $query->orderBy('name')
->offset($pagination->offset)
->limit($pagination->limit)
->createCommand()->rawSql;
public function scenarios()
{
return [
self::DECLINED => ['declined'],
];
}
public function rules()
{
return [
['declined','required','on'=>self::DECLINED],
];
}
public function actionIndex()
{
$model = new Fio('search');
$model->unsetAttributes(); // clear any default values
if (isset($_GET['Fio']))
$model->attributes = $_GET['Fio'];
$dataProvider = $model->search();
$this->render('index', array(
'dataProvider' => $dataProvider,
'model' => $model ,
'phone' => new Phone,
));
}
<?php $this->widget('booster.widgets.TbGridView', array(
'id' => 'type-grid',
'dataProvider' => $dataProvider,
'filter' => $model,
'columns' => array(
'Type_Phone',
array(
'htmlOptions' => array('nowrap' => 'nowrap'),
'class' => 'booster.widgets.TbButtonColumn',
),
),
)); ?>