From 75ce32083842a795607981b533fa85cfa2b7356e Mon Sep 17 00:00:00 2001 From: Tim Tucker Date: Fri, 31 Aug 2012 17:31:00 -0300 Subject: [PATCH 1/3] Update media/src/core/core.constructor.js Allow for adding / removing an arbitrary number of stripe rows --- media/src/core/core.constructor.js | 48 +++++++++++------------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/media/src/core/core.constructor.js b/media/src/core/core.constructor.js index beb1aac1..8af48d54 100644 --- a/media/src/core/core.constructor.js +++ b/media/src/core/core.constructor.js @@ -1,4 +1,3 @@ - var i=0, iLen, j, jLen, k, kLen; var sId = this.getAttribute( 'id' ); var bInitHandedOff = false; @@ -240,42 +239,29 @@ if ( oInit.asStripeClasses === null ) } /* Remove row stripe classes if they are already on the table row */ -var bStripeRemove = false; -var anRows = $(this).children('tbody').children('tr'); -for ( i=0, iLen=oSettings.asStripeClasses.length ; i Date: Fri, 31 Aug 2012 17:37:11 -0300 Subject: [PATCH 2/3] Update media/src/api/api.methods.js Allow for adding / removing an arbitrary number of stripe rows --- media/src/api/api.methods.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/media/src/api/api.methods.js b/media/src/api/api.methods.js index 6773873c..063e71f5 100644 --- a/media/src/api/api.methods.js +++ b/media/src/api/api.methods.js @@ -1,5 +1,4 @@ - /** * Perform a jQuery selector action on the table's TR elements (from the tbody) and * return the resulting jQuery object. @@ -566,12 +565,19 @@ this.fnDestroy = function ( bRemove ) oSettings.nTable.style.width = _fnStringToCss(oSettings.sDestroyWidth); } - /* If the were originally odd/even type classes - then we add them back here. Note - * this is not fool proof (for example if not all rows as odd/even classes - but + /* If the were originally stripe classes - then we add them back here. Note + * this is not fool proof (for example if not all rows had stripe classes - but * it's a good effort without getting carried away */ - $(nBody).children('tr:even').addClass( oSettings.asDestroyStripes[0] ); - $(nBody).children('tr:odd').addClass( oSettings.asDestroyStripes[1] ); + iLen = oSettings.asDestroyStripes.length; + if (iLen) + { + var anRows = $(nBody).children('tr'); + for ( i=0 ; i Date: Fri, 31 Aug 2012 17:45:15 -0300 Subject: [PATCH 3/3] Update media/src/api/api.methods.js Properly select every nth row for adding classes --- media/src/api/api.methods.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/media/src/api/api.methods.js b/media/src/api/api.methods.js index 063e71f5..7ca7f29b 100644 --- a/media/src/api/api.methods.js +++ b/media/src/api/api.methods.js @@ -1,4 +1,3 @@ - /** * Perform a jQuery selector action on the table's TR elements (from the tbody) and * return the resulting jQuery object. @@ -575,7 +574,7 @@ this.fnDestroy = function ( bRemove ) var anRows = $(nBody).children('tr'); for ( i=0 ; i