Pop Up Modal

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?

Also for some reason, I cannot change the size of my Modal, it is defaulting to small, I am calling the size option and passing MODAL_LG (i think thats the right const) but it is only small.

When it pops up it also changes the layout of my menu, I have changed the menu nav to be 100% width, but when the Modal appears the menu gets smaller, I am assuming something funky is happening with CSS, but not sure what.