如何在搜索之前隐藏gridview?

时间:2017-06-12 09:47:18

标签: php mysql yii2

<?php Pjax::begin(); ?>    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'pk_int_payroll_id',
            [
                'attribute' =>  'fk_int_emp_id',
                'value'     =>  'fkIntEmp.vchr_name',
                'filter' => Html::activeDropDownList($searchModel, 'fk_int_emp_id', ArrayHelper::map(TblPayroll::find()->asArray()->all(), 'fk_int_emp_id', 'fk_int_emp_id'),['class'=>'kartik\grid\ActionColumn','prompt' => 'Select name'])
            ],           
            'vchr_worked_hours',
            'vchr_actual_hours',
            [   
                'attribute' =>   'fk_int_payroll_month',
                'value'     =>   'fkIntPayrollMonth.vchr_month'   
            ],
            [   
                'attribute' =>   'fk_int_payroll_year',
                'value'     =>   'fkIntPayrollYear.year'   
            ],



            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
<?php Pjax::end(); ?> </div>

这是我的搜索网格视图。我想搜索,结果应该显示在 网格视图。它工作正常,但在搜索gridview之前显示所有数据,##如何在搜索前隐藏gridview ???是否有可能

0 个答案:

没有答案