Hide/Unhide colum

Hide/Unhide colum

LuddeLudde Posts: 43Questions: 11Answers: 0

Hello,

I use this to change the color of a cell
$(row).find('td:eq(9)').css('background-color', '#F8D90F');

If works,but if I hide one of the colums before column 9,it colors the wrong column. Can I use column name instead of using a number? So it works if I hide a column

Cheers
L

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,274Questions: 26Answers: 4,765
    Answer ✓

    .find('td:eq(9)')

    This is the jQuery find() method which doesn't know anything about the column names. However you can assign a class to the column and use that as the selector. One way to do this is with the columns.className option.

    Kevin

  • LuddeLudde Posts: 43Questions: 11Answers: 0

    Thanks kthorngren for pointing me in the correct direction! You are super!

    Cheers L

Sign In or Register to comment.