Skip to content

Commit 9e9bcf8

Browse files
committed
1012637: updated How to session for react spreadsheet in ug documentation
1 parent 308aa49 commit 9e9bcf8

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

Document-Processing/Excel/Spreadsheet/React/how-to/dynamic-cell-dropdown.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@ documentation: ug
1111

1212
This guide demonstrates how to implement dropdown functionality within cells using custom templates in the Syncfusion React Spreadsheet component.
1313

14+
A template name is added to the cell through setCell, and this tells the Spreadsheet to display a dropdown component instead of normal text.
15+
16+
The dropdown is created using the given options, and after the template is applied, resize is called so the cell adjusts properly.
17+
18+
Templates can also be added automatically when the Spreadsheet is created. For example, you can mark a range of cells with the dropdown template during the created event. This helps when you want certain columns to always show dropdowns without manually updating cells one by one.
19+
20+
You can also add dropdowns dynamically. A custom Ribbon tab is added with a button that inserts a dropdown into the currently selected cell. When the user clicks this button, the template is applied to that cell immediately. This makes it easy for users to add dropdowns anywhere in their sheet while working.
21+
22+
### Dropdown insertion logic
23+
1424
Mark cells with a template and sets `setCell(0, col, sheet, { template: 'dropdown-list' })`.
1525
Initiate the `DropDownList` using `dropDownOptions`.
1626
The calls `resize()` after applying templates.
1727
On selection, call `updateCell({ value })` to save the chosen value in the sheet.
1828
Apply templates programmatically with `setCell` during `created` to pre-configure ranges.
1929

20-
You can also create custom button to dynamically add dropdown lists to specific cells.
21-
22-
A custom Ribbon tab ("Template" -> "DropDown List") is added via addRibbonTabs in created, enabling a dropdown to be injected into the active cell.
30+
If you want to create custom button to dynamically add dropdown lists to specific cells, custom Ribbon tab ("Template" -> "DropDown List") is added via addRibbonTabs in created, enabling a dropdown to be injected into the active cell.
2331

2432
The following code example shows how to add a dropdown from a custom template:
2533

Document-Processing/Excel/Spreadsheet/React/how-to/dynamic-cell-icon.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,22 @@ documentation: ug
1111

1212
This guide demonstrates how to add a custom icons in cells in the Syncfusion React Spreadsheet component.
1313

14+
A template name is assigned to the cell, and this tells the Spreadsheet to render a custom DOM element instead of normal text. The icon is created using a wrapper function, and during beforeCellRender the wrapper is inserted into the cell when the template name matches.
15+
16+
You can mark a cell with this template using updateCell, or you can apply templates automatically in the created event if you want certain cells to show icons when the sheet loads.
17+
18+
You can also add a custom button in the Ribbon so users can insert the icon into the active cell at any time. When the user clicks the button, the template is applied to the selected cell immediately.
19+
20+
The icon inside the cell acts like a normal clickable element. You can attach your own event for actions such as showing child rows, inserting new rows, loading extra data, or anything else you need. The logic stays simple because the cell only stores the template name, and the actual icon is inserted during rendering.
21+
22+
### Icon insertion logic:
23+
1424
Add icons into cells by marking a cell with a template (for example, `updateCell({ template: 'plus-icon' }, address)`) or by initializing templates programmatically in `created`.
1525
The sample creates a DOM wrapper via `createPlusIconWrapper()` and inserts it in `beforeCellRender` when `cell.template === 'plus-icon'`.
26+
1627
You can add the template to the active cell via a custom ribbon button (the sample uses `addRibbonTabs` → "Add Icon"), or apply templates to ranges on initialization.
1728
When inserted, the icon is a clickable DOM element you control; handle clicks to perform actions like expanding rows, loading data, or inserting rows.
29+
1830
This approach keeps logic simple: mark cells with a template, render a small DOM icon in `beforeCellRender`, and respond to click events to implement custom behavior.
1931

2032
The following code example shows how to add custom icons to cells for grouping functionality:

Document-Processing/Excel/Spreadsheet/React/how-to/find-replace-in-range.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ documentation: ug
99

1010
## Find and replace the text within the selected range of cells
1111

12+
It explains how you can limit the Find and Replace action so it works only inside the cells that the user has selected.
13+
14+
When the user clicks Replace All, the Spreadsheet normally searches the whole sheet. To avoid that, the action is checked before it runs. During this check, the selected range in the active sheet is read and expanded into individual cell addresses.
15+
16+
The list of cells that the Replace All action plans to update is then filtered, keeping only the addresses that fall inside the selected range. With this, Replace All updates only the cells the user has selected and nothing outside that area.
17+
1218
Limit the Replace All operation to the user’s current selection by intercepting the Replace action (`actionBegin`) and filtering `eventArgs.addressCollection` using `getActiveSheet().selectedRange`. This ensures only addresses inside the selected range are updated.
1319

1420
This guide explains how to limit the “Replace All” operation so that replacements occur only within the currently selected range of cells in the Syncfusion React Spreadsheet component.

0 commit comments

Comments
 (0)