Trying to implement search box for my page in which user has to enter job_code to get its order status. I'm getting result but this result in grid view I don't want this grid view. So, that I can place various attributes on page at different positions.
Search form In which user has to enter job_code
<?php $form = ActiveForm::begin(['action' => ['tracking'],'method' => 'get','class'=>'lockscreen-credentials']); ?>
<?= $form->field($searchModel, 'job_code')->textInput(array('placeholder' => 'Job Code..'))->label(false); ?>
<?= Html::submitButton('Search', ['class' => 'btn btn-primary btn-block btn-flat']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-primary btn-block btn-flat']) ?>
<?php ActiveForm::end(); ?>
Result Page on which Search Result will display
<body class="lockscreen">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
'job_code',
'client_code',
'company_name',
'job_description:ntext',
'status',
'emp_email:email',
'emp_mobile',
'emp_first_name',
'emp_last_name',
],
]); ?>
</body>
Controllers
public function actionIndex()
{
$model = new Status();
$searchModel = new StatusSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'model' => $model,
]);
}
public function actionTracking()
{
$model = new Status();
$searchModel = new StatusSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('tracking', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'model' => $model,
]);
}
How to achieve this?