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.

Add custom color to w2ui cell

See original GitHub issue

Well, to add color to a cell in grid is very straight forward with the given documentation.

If the records are hard coded then we can add the colors like this

records: [
            { recid: 1, fname: 'Jane', lname: 'Doe', email: 'jdoe@gmail.com', sdate: 384052483664, style: {3:'background-color: yellow; color: white;'}}           
        ]

But when am loading data from server, I need to add style there only( In my case php). I am trying a lot for correct way to add styles to cells and row, from server, but am not getting the desired result.

Could anyone tell me how to color a cell based on my rule(which is defined in the backend)?

Question on stackoverflow : SO Question

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
anubhaw2091commented, Aug 2, 2016

Thanks chalchis. This is working.

Another question, can I change the color of the row as well as the cell?

1st row=> All green color , but 3rd column of the 1st row => red.

Is it possible?

0reactions
haz9ecommented, May 17, 2018

Hi, i’m currently having the same problem but i can’t find any acceptable result, could you please submit your code ? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add custom color to w2ui cell [Grid] - javascript - Stack Overflow
I am trying to add color to the cell of w2ui grid. After following the documentation, I am able to change the color...
Read more >
Grid Basic: Row Styling | w2ui
Joseph Haydn 1732‑1809 Ludwig Van Beethoven 1770‑1827 Wolfgang Amadeus Mozart 1756‑1791 Johann Sebastian Bach 1685‑1750
Read more >
w2grid.columns | JavaScript UI - w2ui
Each column is an object with properties listed below: ... date; time; datetime; color ... I want to add Custom control to the...
Read more >
Grid Basic: Cell Renderers | w2ui
You can define a render function for the column by providing a function (see first column) or you can use predefined renderers (int,...
Read more >
w2form.fields | JavaScript UI - w2ui
I cannot use "list" type of input, because this form is an edit form of a grid which has inline editing (not on...
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