You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/developer/model-driven-apps/clientapi/reference/events/grid-onrecordselect.md
+15-11Lines changed: 15 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -17,21 +17,25 @@ contributors:
17
17
The `OnRecordSelect` event occurs when a single row (record) is selected in the editable grid. This event won't occur if a user selects different cells in the same row, or selects multiple rows.
18
18
19
19
## Example: Override the default open behavior in model-driven grids
20
-
There might be situations where you don't want the table record to open (which is the default behavior), but want a custom action to be performed such as opening a URL using JavaScript functions. Here is an example to acheive this using the [Power Apps Grid Control](../../../../../maker/model-driven-apps/the-power-apps-grid-control) and the `OnRecordSelect` event.
20
+
There might be situations where you don't want the table record to open (which is the default behavior), but want a custom action to be performed such as opening a URL using JavaScript functions. Here is an example to acheive this using the [Power Apps Grid Control](../../../../../maker/model-driven-apps/the-power-apps-grid-control) and the `OnRecordSelect` event. In this example it simply navigates to a specific contact form.
21
21
22
22
### Step 1: Create a web resource
23
23
24
-
Create, save and publish a JavaScript (JS) web resource that contains the following code. This example uses **contact** table. Set the `entityName` you want to use.
24
+
Create, save and publish a JavaScript (JS) web resource that contains the following code. This example uses **contact** table and a specific form. Set the `entityName` you want to use.
More information: [Create or edit model-driven app web resources ](../../../../../maker/model-driven-apps/create-edit-web-resources.md)
@@ -46,7 +50,7 @@ Follow these steps to enable the **Power Apps Grid Control** as the main grid (t
46
50
When enabling the **Power Apps Grid Control**, an **Events** tab appears. Select the **Events** tab:
47
51
1. Under the **Form Libraries** section, add the Form Libary from the web resource just created.
48
52
2. Under the **Event Handlers** section, select the event **OnRecordSelect** and click Add, a popup will appear.
49
-
3. In the popup, select the form library just added and the Function name **OnSelect**. This is the name of the JavaScript function created in the web resource, and make sure to check the option **Pass execution context as first parameter**.
53
+
3. In the popup, select the form library just added and the Function name **Example.OnSelect**. This is the name of the JavaScript function created in the web resource, and make sure to check the option **Pass execution context as first parameter**.
50
54
51
55
52
56
For more infomation, see [Power Apps Grid Control](../../../../../maker/model-driven-apps/the-power-apps-grid-control)
0 commit comments