Other tables css class affected

Other tables css class affected

johnny2002johnny2002 Posts: 8Questions: 0Answers: 0
edited June 2010 in Bug reports
I am using dataTables 1.7 beta 3 in one table, while, it also changed the other tables' css class.
As I looked into detail, I found the root cause as following:
The original code at line 5976 in jquery.dataTables.js:
[code] /* Remove row stripe classes if they are already on the table row */
var bStripeRemove = false;
for ( i=0, iLen=oSettings.asStripClasses.length ; i

Replies

  • allanallan Posts: 57,300Questions: 1Answers: 9,127 Site admin
    Hi johnny2002,

    Excellent point - thank you for picking up on this, letting me know and fixing it!!!

    The fix will be included in the next beta :-)

    Regards,
    Allan
  • johnny2002johnny2002 Posts: 8Questions: 0Answers: 0
    edited June 2010
    Hi Allan,

    Thanks for you response so quickly and your excellent plug-in. Moreover, for performance consideration, do you think the following code will be a little bit faster?
    [code]
    /* Remove row stripe classes if they are already on the table row */
    var bStripeRemove = false;
    var theRows = $('tbody>tr', this);
    for ( i=0, iLen=oSettings.asStripClasses.length ; i
  • allanallan Posts: 57,300Questions: 1Answers: 9,127 Site admin
    Hi johnny2002,

    I've just tried out your code in my performance testing rig, and it does indeed appear to provide a slight optimisation (more when the rows do have classes that need to be striped):

    Using DataTables 1.7 beta 3's method: average of roughly 645mS
    Using the method above: average of roughly 640mS

    Nice one! Thanks :-). This will also be in the next release.

    Regards,
    Allan
This discussion has been closed.