From 3e03703e3277d738b964afd6916c163c5b36aaed Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 22 Nov 2015 10:20:35 -0600 Subject: [PATCH 1/2] Adding the originalTR to the record object --- jquery.dynatable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jquery.dynatable.js b/jquery.dynatable.js index 9285e1e..9888eab 100644 --- a/jquery.dynatable.js +++ b/jquery.dynatable.js @@ -675,6 +675,7 @@ tableRecords.each(function(index){ var record = {}; record['dynatable-original-index'] = index; + record["originalTR"] = $(this); $(this).find('th,td').each(function(index) { if (columns[index] === undefined) { // Header cell didn't exist for this column, so let's generate and append From 32918c4093939bb901b1f172d541cb978a594fa8 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 13 Dec 2015 16:25:25 -0600 Subject: [PATCH 2/2] Adding an option to copy the original TR class only if it exists --- jquery.dynatable.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jquery.dynatable.js b/jquery.dynatable.js index 9888eab..11847cc 100644 --- a/jquery.dynatable.js +++ b/jquery.dynatable.js @@ -50,7 +50,8 @@ pushState: true, search: true, recordCount: true, - perPageSelect: true + perPageSelect: true, + copyTRClass: false }, table: { defaultColumnIdStyle: 'camelCase', @@ -675,7 +676,11 @@ tableRecords.each(function(index){ var record = {}; record['dynatable-original-index'] = index; - record["originalTR"] = $(this); + if (settings.features.copyTRClass) { + if ($(this)[0].className && $(this)[0].className != "") { + record["originalTRClass"] = $(this)[0].className; + } + } $(this).find('th,td').each(function(index) { if (columns[index] === undefined) { // Header cell didn't exist for this column, so let's generate and append