Help Reset Zebra (after className change)
Help Reset Zebra (after className change)
ericmfulton
Posts: 3Questions: 0Answers: 0
Hey,
First post and i'm a big newbie so I apologize for any faux pas.
I have a table where when you click on a button in a row, it should change the color of that row by changing the class name from:
gradeB to gradeX
The problem is that once the table is initialized, the classname changes to "gradeB odd" or gradeB even." When i manually change the classname to "gradeX" I only get "gradeX" and not "gradeX even/odd." The only way I can seem to force the odd/even stuff to recalculate is by manually hitting a TH to resort the table. That somehow also recalculates odd even stuff.
I'd greatly appreciate any help. Below is a snippet of my code:
//Change Color
that.parentElement.parentElement.className = "gradeX";
//Get Index
var dex = tab1Reference.fnGetPosition(that.parentNode.parentNode);
//Change Status
tab1Reference.fnUpdate("Urgent", dex, 5, true);
=====>Purpose: Things that are urgent in my table should be red("gradeX"), otherwise they should be blue("gradeB").
Thanks for any help!!!
First post and i'm a big newbie so I apologize for any faux pas.
I have a table where when you click on a button in a row, it should change the color of that row by changing the class name from:
gradeB to gradeX
The problem is that once the table is initialized, the classname changes to "gradeB odd" or gradeB even." When i manually change the classname to "gradeX" I only get "gradeX" and not "gradeX even/odd." The only way I can seem to force the odd/even stuff to recalculate is by manually hitting a TH to resort the table. That somehow also recalculates odd even stuff.
I'd greatly appreciate any help. Below is a snippet of my code:
//Change Color
that.parentElement.parentElement.className = "gradeX";
//Get Index
var dex = tab1Reference.fnGetPosition(that.parentNode.parentNode);
//Change Status
tab1Reference.fnUpdate("Urgent", dex, 5, true);
=====>Purpose: Things that are urgent in my table should be red("gradeX"), otherwise they should be blue("gradeB").
Thanks for any help!!!
This discussion has been closed.
Replies
> The only way I can seem to force the odd/even stuff to recalculate is by manually hitting a TH to resort the table.
Call fnDraw - that will reorganising the classes.
> that.parentElement.parentElement.className = "gradeX";
It would probably be better to use $().addClass() and $().removeClass() since that won't kill the odd/even classes.
Allan
Thank you so much!!!!!!!! Using addClass and removeClass did the trick. Everything is working perfectly now. I can't tell you how much time I've spent trying to figure this one out. I really really appreciate your help!
Thanks!