Change css Ajax success

Change css Ajax success

sks82sks82 Posts: 2Questions: 1Answers: 0

Hi,i have to try change css cell or row after ajax success. With jquery by id selector no problem because it's on screen.
$('#idofcell').css('background-color', 'greenyellow');
But when a filter is active the #idofcell not exist and css not applied. Which is the way of change it on table.cell or table row ?? All tr and td have id.
var filaTR = table.row('#25666');
console.log($(filaTR));

Thanks¡¡¡

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,452Questions: 26Answers: 4,975
    Answer ✓

    If #idofcell refers to a specific cell you can use cell().node() to get the cell's node. I think this might work:

    $( table.cell( '#idofcell' ).node() ).css('background-color', 'greenyellow');
    

    You can do something similar if you are trying to apply the CSS to a row with row().node().

    Kevin

  • sks82sks82 Posts: 2Questions: 1Answers: 0

    I had a little mess of concepts. I was using .css without jquery($). Works perfect.
    Thanks¡¡¡

Sign In or Register to comment.