Jquery show render page in gridview yii2 -
i trying create feedback page put gridview on page show feedbacklist, , have plan put list replay under current comment.
'columns' => [ [ 'attribute' => 'iduser.photo', 'format' => 'html', 'value'=> function($data) { return html::img($data->imageurl) . " <p class='feedback-username'>" . $data->username . "</p>"; }, 'contentoptions'=>['style'=>'max-width: 10px; max-height: 10px'], ], [ 'attribute' => 'komentar', 'format' => 'raw', 'value' => function($model) { return $model->komentar ."<br><p class='feedback-date'>". $model->tanggal ."</p><hr><div id='replay'><ul></ul></div>";}, ], [ 'class' => 'yii\grid\actioncolumn', 'contentoptions'=>['style'=>'width: 5px;'], 'template' => '{update} {delete}', 'visible' => !yii::$app->user->isguest, ],
i want use jquery slip list replay in id = replay > ul
this controller made:
public function actionreplay() { $searchmodel = new feedbacksearch(); $dataprovider = $searchmodel->searchreplay();; return $this->render('replay', [ 'searchmodel' => $searchmodel, 'dataprovider' => $dataprovider ]); }
and model:
public function searchreplay() { $dataprovider = feedback::find()->where("replayed = '1'")->all(); return $dataprovider; }
the view show list:
<?php foreach ($dataprovider $model) { echo $model->komentar; }
how can put list data in grid view? think of jquery still have no idea.
Comments
Post a Comment