Patch for forced secondary etc. sorts
Patch for forced secondary etc. sorts
syndesis
Posts: 12Questions: 0Answers: 0
I had a requirement similar to the one in http://www.datatables.net/forums/discussion/comment/45129
You mentioned that maybe DataTables should provide an option for this internally so I added one. This option is nearly identical to aaSortingFixed, except it sorts after the selected sort instead of before. Patch follows. Please let me know if I should submit a pull request or if you think it should be implemented in a different way.
[code]
diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js
index 89179c8..ea39b9e 100644
--- a/media/js/jquery.dataTables.js
+++ b/media/js/jquery.dataTables.js
@@ -2057,7 +2057,11 @@
aaSort = ( oSettings.aaSortingFixed !== null ) ?
oSettings.aaSortingFixed.concat( oSettings.aaSorting ) :
oSettings.aaSorting.slice();
-
+
+ if ( oSettings.aaPostSort !== null ) {
+ aaSort = aaSort.concat( oSettings.aaPostSort );
+ }
+
for ( i=0 ; i
You mentioned that maybe DataTables should provide an option for this internally so I added one. This option is nearly identical to aaSortingFixed, except it sorts after the selected sort instead of before. Patch follows. Please let me know if I should submit a pull request or if you think it should be implemented in a different way.
[code]
diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js
index 89179c8..ea39b9e 100644
--- a/media/js/jquery.dataTables.js
+++ b/media/js/jquery.dataTables.js
@@ -2057,7 +2057,11 @@
aaSort = ( oSettings.aaSortingFixed !== null ) ?
oSettings.aaSortingFixed.concat( oSettings.aaSorting ) :
oSettings.aaSorting.slice();
-
+
+ if ( oSettings.aaPostSort !== null ) {
+ aaSort = aaSort.concat( oSettings.aaPostSort );
+ }
+
for ( i=0 ; i
This discussion has been closed.
Replies
In 1.10 the aaSortingFixed parameter is now primarily referred to as `orderingFixed` (backwards compatible!), so I'm wondering if it should be an object which allows post fix and prefix parameters when given as an object...
Allan
Regards,
Allan