DT 1.10 Render cells
DT 1.10 Render cells
deliator
Posts: 95Questions: 1Answers: 0
HI,
http://live.datatables.net/cixitino/1/
I don't understand why the value of the first column/second row is not render in red...
Any idea ?
Thx
Marc
This discussion has been closed.
Replies
Hey Marc, it's in red for me.
Looks like you might have edited the page since the original post - the HTML for the body row in the table isn't valid.
Allan
Updated.
http://live.datatables.net/hosuleli/1/
I have exaclty the same code in my page but value don't appear in red ...
The only thing that changed si that i work server side ...
Any idea ?
If the example is working but your site is not then without seeing it its hard to diagnose. I would suggest using console.log statements in your
columns.render
function to output the variables and to see if theif
statement is ever true and setting the red style. From there you can determine whether to troubleshoot a styling issue or an issue with your if statement.Kevin
console.log in the sandbox gives me the exact values
http://live.datatables.net/wozuyana/3/
when i add the same console.log(row[2]); in my page it returns me an undefined value.
Are you using
columns.data
to define your columns? If so then you need to access the row data as an object not an array.Kevin
Yes i use
columns.data
...How can I access the row data as an object ?
Can you give me an example ?
Thank you
If you have this for example:
And you wanted the data in the
office
column you would userow.office
in your render function.Kevin
Great Kevin, it works fine now :-)
you take away a thorn from my feet ;-)
Thanks again.
Marc