Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
975
How to get/ set CSS class of a cell
posted

Hi all,

I would like to know how I could get/ set the css class of a particular cell in JavaScript? Thanks.

Parents
No Data
Reply
  • 37874
    posted

    Hello aschoi,

    You can get a particular cell by the row and column indices using the cellAt method:

    var cell = $('#grid1').igGrid('cellAt', 1, 1);

     

     Then you can get/set the class like this:

    var class = $(cell).attr('class');

    $(cell).addClass('red');

    Please let me know if you have any other questions.

     

Children