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.

PF4 react-table colums (title) to support jsx (also in collapsed view)

See original GitHub issue

Pretty pretty please, would be great if pf-table didn’t hate this

this kinda thing

    const [cols] = useState([
        { title: intl.formatMessage(messages.rulesTableColumnTitleRule), transforms: [sortable] },
        { title: intl.formatMessage(messages.rulesTableColumnTitleAdded), transforms: [sortable, cellWidth(15)] },
        { title: intl.formatMessage(messages.rulesTableColumnTitleTotalrisk), transforms: [sortable] },
        { title: intl.formatMessage(messages.rulesTableColumnTitleSystems), transforms: [sortable] },
        { title: <><AnsibeTowerIcon size='md' /> {intl.formatMessage(messages.rulesTableColumnTitleAnsible)}</>, transforms: [sortable] }
    ]);

throws this warning (it doesn’t enjoy the <><AnsibeTowerIcon size='md' />...</> Screen Shot 2019-09-16 at 3 10 23 PM

also, it doesn’t collapse very well, displays fallback rather than the column name

Screen Shot 2019-09-16 at 3 08 48 PM

what it oughta look like

Screen Shot 2019-09-16 at 3 09 00 PM

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
mcokercommented, Sep 25, 2019

@AllenBW sounds good! Let me know if you want to brainstorm or if I can help out in any way.

2reactions
mcokercommented, Sep 25, 2019

@AllenBW the problem with this approach and how the table is configured currently is that we use the data-label attribute on each cell to generate the title/header via CSS on the left of each cell in the mobile/responsive layout. We do that by using content: attr(data-label); in the ::before pseudo element of each cell, and unfortunately the content property value isn’t parsed by the browser, so it won’t render HTML in the document tree.

To be able to display the content of the table columns from the default table view (desktop) to the grid layout view (responsive/mobile), I think we would need to consider a different approach.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expanded row getting collapsed on state update on react-table
on selecting or unselecting the checkbox (state update) the expanded row is getting collapsed please help me in solving this. I have tried...
Read more >
How to use the react-table.ReactTableDefaults.column ... - Snyk
To help you get started, we've selected a few react-table.ReactTableDefaults.column examples, based on popular ways it is used in public projects.
Read more >
React Table: A complete tutorial with examples
In this React table tutorial, we'll show you how to implemenet your own data table in React using react-table, complete with examples.
Read more >
PatternFly 4 • Release notes
PatternFly is Red Hat's open source design system. It consists of components, documentation, and code for building enterprise applications at scale.
Read more >
React Table: A Complete Guide - Hygraph
We can use react-tables for basic features such as sorting, filtering (global and column), pagination, and lots more.
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