question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Table expandedRowClassName not called

See original GitHub issue
  • [ x ] I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Create table with expandable => expandedRowClassName.

 <Table
      dataSource={...}
      columns={...}
      expandable={{
        expandedRowClassName: (record, index, indent) => {
          console.log("call expandedRowClassName", record, index, indent);
          return "myspecialclassname";
        }
      }}
    />

What is expected?

expandedRowClassName should be called and the returned string should be applied as classname of the tr

What is actually happening?

expandedRowClassName is not called.

Environment Info
antd 4.15.1
React 17.0.1
System mac os
Browser Chrome 89

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mboettchercommented, Apr 13, 2021

Thanks @afc163 for the fast reply.

I think it’s not clear in the documentation that it can only be used for expandedRowRender since others like onExpand or expandIconColumnIndex apply for tree data as well. Also, I do not see the reason, why it should be limited to expandedRowRender.

If you agree that this should not be limited to expandedRowRender I could create a feature request, or, if I have some spare time, try to create a pull request for it.

0reactions
afc163commented, Apr 17, 2021

trace #30180

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ant Design Table expanded change CSS class | React
I have created function onExpand of the table. onExpand = (expanded, record) => { alert(expanded); console.log('onExpand', expanded, ...
Read more >
Table: Use expandedRowClassName also for tree data #30180
[ x ] I have searched the issues of this repository and believe that this is not a duplicate. What problem does this...
Read more >
Table - Ant Design
A table displays rows of data. When To Use. To display a collection of structured data. To sort, search, paginate, filter data. How...
Read more >
rc-table - npm
There are 507 other projects in the npm registry using rc-table. ... Function(recode, index, indent):string, get expanded row's className.
Read more >
Building a TreeTable Using Ant Design System | by Jennifer Fu
A Table, also called a data grid, is an arrangement of data in rows and ... For a TreeTable, the subtable's column header...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found