Keep class when using fnOpen

Keep class when using fnOpen

danielwidanielwi Posts: 3Questions: 0Answers: 0
edited May 2012 in General
I'm adding a new element using fnOpen and would like the background color to be the same as the "parent" tr. The problem is that when a user re-sorts the table the "parent" tr might switch from class odd to even. How can I make my element also switch class at the same time?

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    What you'd need to do is use fnDrawCallback to pass over the TR elements in the table on each draw and just make sure that your own rows are the correct class. fnIsOpen might be of some use.

    Allan
  • danielwidanielwi Posts: 3Questions: 0Answers: 0
    Thanks Allan. If this is a common problem then you maby could add a example to the fnOpen or fnDrawCallback documentation?
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    I'll certainly keep a look out for any other posts requesting help or examples with this kind of thing and post up an example as required :-)

    Regards,
    Allan
  • danielwidanielwi Posts: 3Questions: 0Answers: 0
    Thank you!
This discussion has been closed.