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.

expand by column: expandable={false} not working while column is custom format

See original GitHub issue

click the cell with button or badge still can expand the row

settingFormatter(cell, row){
    return (
      <span>
        <Button role='button' className="btn btn-outline-info" onClick={() => this.props.loadOffSideBar(true, ACT_TYPE_EDIT, row.id, row.name, row.text)} ><FontAwesome name='pencil' /></Button>
        <Button role='button' className="btn btn-outline-danger ml-3" onClick={() => this.props.deleteEvent(row)} ><FontAwesome name='times' /></Button>
      </span>
    );
  }
  statusFormatter(cell, row){
    return (
      <span>
        {row.isPublish ?
          <Badge color='success' className="p-2">Published</Badge>:
          <Badge color='warning' className="p-2">Draft</Badge>
        }
      </span>
    );
  }
<TableHeaderColumn dataField="status" dataAlign="center" expandable={ false } dataFormat={this.statusFormatter}>
                Status
              </TableHeaderColumn>
              <TableHeaderColumn dataField="setting" dataAlign="center" expandable={ false } dataFormat={this.settingFormatter}>
                {this.renderCustomHeader()}
              </TableHeaderColumn>

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Feniciocommented, Sep 15, 2017

Hi, I just reproduced this error and found out why it’s happening.

In TableRow, on the rowClick method, when it’s attempting to get the cellIndex (Line 16 as of now) if the dataFormat adds another html tag, a div, a span or whatever, when it tries to find the cellIndex is going to return undefined.

One possible solution would be to loop back through the .parentNode of the e.target to get the first td element, and then get the cellIndex of that.

0reactions
SagaGGcommented, Sep 22, 2017

@AllenFang @Fenicio Thank you guys, good job. sorry for looking into it late

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excel table not formatting new rows appropriately - Super User
To resolve this click on the header of a column then right click and choose "Format Cells" option and set the desired format....
Read more >
Table expanded row props #10379 - ant-design/ant ... - GitHub
Some rows are expandable and some are not, expandedRowProps(record).expandable // false; Expanded row fetches record details on open, so closing ...
Read more >
Work with a List, Record, or Table structured column (Power ...
A column of complex values, such as tables, lists, records or links, can be expanded to reveal the values contained in the complex...
Read more >
Set the table column width constant regardless of the amount ...
You need to set the cell width (either th or td worked, I set both) AND set the table-layout to fixed . For...
Read more >
Excel Table Doesn't Expand For New Data - Contextures Blog
This week, while working on a client's Excel project, ... To fix the tables, so they automatically expand to include new rows or...
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