> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codenullapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Open a Feature on a Modal

> We have a GridList with a Global Action that says "Add Product" and we want to open a form to add a new Product, if we want to open that feature as a modal you 

### Not passing parameters to the modal

We have a GridList with a Global Action that says "Add Product" and we want to open a form to add a new Product, if we want to open that feature as a modal you should the following steps:

1. Go to the designer of the GridList feature
2. In the Global Actions Configuration section check the option "Open/Close in a modal"
3. Select the feature you want to open on the Modal. The final configuration should looks like the next image:

<img src="https://mintcdn.com/codenull/9RtgKoAtzvpYtN-c/images/-MeggWvUWkjZ2LJex6Xy.png?fit=max&auto=format&n=9RtgKoAtzvpYtN-c&q=85&s=ecb58124aa2665fda63fd6e34c4a129f" alt="" width="598" height="459" data-path="images/-MeggWvUWkjZ2LJex6Xy.png" />

### Passing parameters to the modal

<Info>
  This is useful when we want to edit an item in a modal and we want the `Id` from the context of the Row
</Info>

In the same GridList, once the user clicks any item, we want to open a Feature with the details of the selected item, to achieve that we would need to pass parameters

#### On the feature that will open the modal...

1. Go to the designer of the GridList feature
2. In the Default Click Actions Configuration section check the option "Open/Close in a modal"
3. Select the feature you want to open on the Modal.
4. Besides that, configure the params (On the Params option) you want to pass to the Feature you want to open in the modal. In this case, we want to pass the Id that comes from the context

<img src="https://mintcdn.com/codenull/9RtgKoAtzvpYtN-c/images/-Megi2g01ha-qfw5-FIA.png?fit=max&auto=format&n=9RtgKoAtzvpYtN-c&q=85&s=8abc0b8430530e76af51d86ca7aede73" alt="Configuration of the GridList " width="631" height="274" data-path="images/-Megi2g01ha-qfw5-FIA.png" />

<Info>
  If you don't define any parameter the entire data item of the GridRow will be passed to the modal&#x20;
</Info>

#### On the Feature that will be opened...

Now we need to make sure that the feature that will be opened in the modal, receives those parameters from the context in the data source.

1. Go to the designer of the feature that needs to be opened
2. On the datasource add the received parameters. In this case, we want the `id` variable from the context

<img src="https://mintcdn.com/codenull/9RtgKoAtzvpYtN-c/images/-MegjlxeTwaE5aKHC8BU.png?fit=max&auto=format&n=9RtgKoAtzvpYtN-c&q=85&s=b3d7d800b7fe38966c1136f045ed8ae8" alt="Configuration of the feature we want to open" width="1116" height="597" data-path="images/-MegjlxeTwaE5aKHC8BU.png" />

<Info>
  Tip: To avoid double cards on the modal don't forget to enable the "Plain mode" check on the Layout section
</Info>

<img src="https://mintcdn.com/codenull/9RtgKoAtzvpYtN-c/images/-MeglkaNksqRNFBSZuG8.png?fit=max&auto=format&n=9RtgKoAtzvpYtN-c&q=85&s=4e6cc08eca9d7603fea0a3d31bae7970" alt="" width="275" height="95" data-path="images/-MeglkaNksqRNFBSZuG8.png" />

<Info>
  This only works for Navigation Buttons
</Info>

### Redirect between Modals

Redirect from a Modal to another Modal, (e.g. Adding a new record when it is created can be shown in Edit mode in the same modal)

* if you want to use it, go to the submit Datasource form in the designer and configure the new onCompleted option "Redirect To Another Modal"

<img src="https://mintcdn.com/codenull/9RtgKoAtzvpYtN-c/images/-Mj5K7Sg0JNzxW3pCl9V.png?fit=max&auto=format&n=9RtgKoAtzvpYtN-c&q=85&s=6d35831fbfa8cae2c68839f10f04e0b0" alt="" width="664" height="453" data-path="images/-Mj5K7Sg0JNzxW3pCl9V.png" />

##
