Skip to content

Commit ad45be6

Browse files
committed
acrolinx
1 parent 4cfa0ed commit ad45be6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

powerapps-docs/developer/model-driven-apps/clientapi/reference/events/grid-onrecordselect.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ contributors:
1515
---
1616
# Grid OnRecordSelect event (Client API reference)
1717

18-
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+
The `OnRecordSelect` event occurs when a single row (record) is selected in the editable grid. This event doesn't occur if a user selects different cells in the same row, or selects multiple rows.
1919

2020
## Example: Override the default open behavior in model-driven grids
2121

22-
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 achieve this using the [Power Apps grid control](../../../../../maker/model-driven-apps/the-power-apps-grid-control.md) and the `OnRecordSelect` event. The following function will ensure that the record opens using the form specified `pageInput` `formId` value.
22+
When you want to customize the way that a table record opens from the [Power Apps grid control](../../../../../maker/model-driven-apps/the-power-apps-grid-control.md), you can control how this opens with a JavaScript function associated with the grid `OnRecordSelect` event.
23+
24+
The following example ensures that the record opens using the form specified `pageInput` `formId` value using the [Xrm.Navigation.navigateTo](../Xrm-Navigation/navigateTo.md) method.
2325

2426
### Step 1: Create a web resource
2527

26-
Create, save and publish a JavaScript (JS) web resource that contains the following code:
28+
Create, save, and publish a JavaScript (JS) web resource that contains the following code:
2729

2830
```JavaScript
2931
var Example = window.Example || {};
@@ -51,10 +53,10 @@ Follow these steps to enable the **Power Apps Grid Control** as the main grid (t
5153

5254
### Step 3: Register the custom behavior on OnRecordSelect Event
5355

54-
When enabling the **Power Apps Grid Control**, an **Events** tab appears. Select the **Events** tab:
56+
When you enable the **Power Apps Grid Control**, an **Events** tab appears. Select the **Events** tab:
5557

56-
1. Under the **Form Libraries** section, add the Form Library from the web resource just created.
57-
1. Under the **Event Handlers** section, select the event **OnRecordSelect** and click Add, a popup will appear.
58+
1. Under the **Form Libraries** section, add the Form Library from the web resource created.
59+
1. Under the **Event Handlers** section, select the event **OnRecordSelect** and select **Add** and a popup appears.
5860
1. 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. Make sure to check the option **Pass execution context as first parameter**.
5961

6062
More information: [Power Apps grid control](../../../../../maker/model-driven-apps/the-power-apps-grid-control.md)

0 commit comments

Comments
 (0)