Highlighting another cell on same row as specified value

Highlighting another cell on same row as specified value

silkspinsilkspin Posts: 152Questions: 34Answers: 5

I probably shouldn’t have asked this in another question so I’ve made it into a standalone question.

After finding the highest (or lowest) date I don’t want to put the marker in the same cell which $(this.node()) does. I’d like to change the style of the "Name" cell (column 1)?

Does anyone know how to change the example below so this.node has the correct code for putting the red cross at the side of the name?

I’ve tried following examples of rows().nodes() and cells() with rowSelector/columnSelector to get the row with no luck.

http://live.datatables.net/cokucuda/5/edit

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    edited March 2021 Answer ✓

    You can do something like this: http://live.datatables.net/cokucuda/7/edit

    We'll get back to you about how to get the crosses on the same line.

    Colin

  • silkspinsilkspin Posts: 152Questions: 34Answers: 5
    edited March 2021

    That's fantastic @colin It's exactly how I wanted it to work. I will actually be putting a CSS label under the content rather than having it appear after. I just used the "X" to make it simpler. If anyone wants it to appear after then changing the <div> to <span> will do it.

    Can I ask whether it's possible to use an object name for the column rather than number (in this case 0)? I tried that (both in quotes and without) but it didn't work in my main project. $(api.cell(this.node(), 0)

    I must point out it's not that important, so I'm happy to stick with numbers.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    That's the column-selector, and there are different ways to specify that (see the reference page),

    Colin

This discussion has been closed.