Skip to content

Commit 15c5fff

Browse files
authored
docs(AnalyticalTable): add note about cell property of popped-in cells (#5225)
Closes #5224
1 parent 238b407 commit 15c5fff

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

packages/main/src/components/AnalyticalTable/AnalyticalTable.mdx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,19 +454,33 @@ const COLUMNS = [
454454
455455
### How to change the content of the pop-in cell?
456456
457-
You can change the content of the pop-in cell without mutating the original cell by using the `isPopIn` prop of the table instance returned by the `Cell` column option:
457+
You can change the content of the pop-in cell without mutating the original cell by using the `isPopIn` prop of the table instance returned by the `Cell` column option.
458+
459+
**Note:** The `cell` property of the custom `Cell` renderer, always returns the properties and values of the cell the "popin" cell is rendered into.
458460
459461
```js
460462
const COLUMNS = [
463+
{
464+
Header: 'Name',
465+
accessor: 'name'
466+
},
461467
{
462468
responsivePopIn: true,
463469
responsiveMinWidth: 600,
464470
id: 'col',
465471
Header: 'Column',
466-
Cell: ({ isPopIn }) => {
472+
Cell: ({ isPopIn, cell, value }) => {
467473
if (isPopIn) {
474+
// this will log the properties of the `name` cell (e.g. `cell.value` is the value of the `name` cell)
475+
console.log(cell);
476+
// this will always log the value of this cell (`col` cell)
477+
console.log(value);
468478
return 'pop-in content';
469479
}
480+
// this will log the properties of this cell (e.g. `cell.value` is the value of the `col` cell)
481+
console.log(cell);
482+
// this will always log the value of this cell (`col` cell)
483+
console.log(value);
470484
return 'original content';
471485
}
472486
}

0 commit comments

Comments
 (0)