I currently have this in my controller which I use to return a modal.
public function actionView($id)
{
$model = new SupplierMaintanance();
$model->suppliercode = $id;
$model->loadsupplier();
return $this->renderAjax('_view', [
'model' => $model,
'isnew' => $new,
'items' => $this->items
]);
}
In my gridview I have changed the data column so that it is an anchor which points to this action. It works fine most of the time, but occasionally it will change the url to this action as opposed to just popping up the modal. So it will go to /controller/view?id=1 instead of doing it and returning the modal.
Is there a different way to do this to ensure that the modal will appear 100% of the time?