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.

set dynamically css class for rows

See original GitHub issue

I need to set dynamically css class for rows if they contains some specific text. I did it with componentDidUpdate like this:

 componentDidUpdate: function(a,b) {
    $(this.getDOMNode()).find(" td span:contains('UD')").parents("tr").addClass("red");
  },

But it work’s only one, when data loaded into table. And after filter or sort - table refreshing. What is better way for i? I need to change only css classes in rows. Not all CustomRowComponent or all events.

Thank you!

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Debanandacommented, Nov 15, 2018

Thanks @dahlbyk. It working as charm …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamically change CSS class of a row in a table
If the value of the cell changes dynamically and you just want all the cells to match, try: $(document).ready(function() { var baseval =...
Read more >
[HOW TO] Dynamically set HtmlTableRow CssClass attribute
User-391564799 posted. I am mocking up a simple HTML table that has n rows. I want to alternate the CssClass of each row...
Read more >
Changing 'CSS Classes' column attribute dynamically based ...
I wanted to use the "CSS Classes" attribute to dynamically set the CSS Class based on the column value. However, apparently this field...
Read more >
apply css class to dynamically generated table row - P2P Wrox
I have a javascript function which will add rows dynamically. But the problem is how should i apply css class to those dynamically...
Read more >
Dynamically change css classes for row · Issue #2556 - GitHub
Hi all The question is - how to change css classes for rows? Overview: I have REPEATING 2 rows - A and B....
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