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: Document-Processing/PDF/PDF-Viewer/react/context-menu/custom-context-menu.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ You can add custom options to the context menu using the [addCustomMenu()](https
21
21
1. Define the menu items as an array of objects.
22
22
2. Call the [`addCustomMenu`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#addcustommenu) method within the [`documentLoad`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#documentload) event handler.
23
23
24
-
```jsx
24
+
```js
25
25
exportfunctionApp() {
26
26
27
27
let menuItems = [
@@ -83,7 +83,7 @@ root.render(<App />);
83
83
84
84
The [customContextMenuSelect()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#customcontextMenuselect) method defines actions for custom menu items.
85
85
86
-
```jsx
86
+
```js
87
87
functioncustomContextMenuSelect(args) {
88
88
var viewer =document.getElementById('container').ej2_instances[0];
89
89
switch (args.id) {
@@ -167,7 +167,7 @@ function setReadOnlyFalse(args) {
167
167
168
168
The [customContextMenuBeforeOpen()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#customcontextMenubeforeopen) event allows for dynamic showing or hiding of items based on selection or document state.
@@ -157,7 +157,7 @@ The React PDF Viewer can be embedded into dashboards, admin panels, split‑scre
157
157
-**Use viewer inside Tab components**
158
158
- The react PDF Viewer are also supported inside Syncfusion tab components.
159
159
160
-
```tsx
160
+
```ts
161
161
// App.tsx
162
162
import React, { useRef } from 'react';
163
163
import { TabComponent, TabItemsDirective, TabItemDirective } from '@syncfusion/ej2-react-navigations';
@@ -230,7 +230,7 @@ The React PDF Viewer can be embedded into dashboards, admin panels, split‑scre
230
230
-**Use viewer inside Dialog**
231
231
- If the viewer sits inside a dialog, for example Syncfusion Dialog, render or initialize the viewer after the dialog open events. The DOM must be visible for the viewer to measure layout.
232
232
233
-
```tsx
233
+
```ts
234
234
// App.tsx
235
235
import React, { useRef, useCallback } from 'react';
236
236
import { DialogComponent } from '@syncfusion/ej2-react-popups';
@@ -301,7 +301,7 @@ The React PDF Viewer can be embedded into dashboards, admin panels, split‑scre
301
301
-**Use viewer inside Collapsible sections**
302
302
- For accordions or collapsible containers, either render the viewer lazily when the section expands or dispatch the resize event after expansion so the viewer can recompute layout.
303
303
304
-
```tsx
304
+
```ts
305
305
// App.tsx
306
306
import React, { useCallback, useRef } from 'react';
0 commit comments