Revision: 2036
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2036&view=rev
Author:   cimorrison
Date:     2011-09-30 13:06:50 +0000 (Fri, 30 Sep 2011)
Log Message:
-----------
Restructured code to avoid warning messages in JavaScript console about 
reinitialising ColReorder when the window is resized

Modified Paths:
--------------
    mrbs/branches/datatables/web/Themes/default/header.inc

Modified: mrbs/branches/datatables/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/datatables/web/Themes/default/header.inc      2011-09-30 
10:13:33 UTC (rev 2035)
+++ mrbs/branches/datatables/web/Themes/default/header.inc      2011-09-30 
13:06:50 UTC (rev 2036)
@@ -234,15 +234,10 @@
             defaultOptions.bProcessing = true;
             defaultOptions.bScrollCollapse = true;
             defaultOptions.bStateSave = true;
-            <?php
-            // If we're using an Ajax data source then don't offer 'R' (column 
reordering).
-            // This is a problem at the moment in DataTables because if you 
reorder a column
-            // DataTables doesn't know that the Ajax data is still in the 
original order.
-            // May be fixed in a future release of DataTables
-            ?>
-            defaultOptions.sDom = (specificOptions.sAjaxSource) ? 
'C<"clear">lfrtip' : 'RC<"clear">lfrtip';
+            defaultOptions.sDom = 'C<"clear">lfrtip';
             defaultOptions.sScrollX = "100%";
             defaultOptions.sPaginationType = "full_numbers";
+            defaultOptions.oColReorder = {};
             defaultOptions.oColVis = {sSize: "css",
                                       buttonText: '<?php echo 
get_vocab("show_hide_columns") ?>',
                                       bRestore: true,
@@ -289,6 +284,16 @@
             var mergedOptions = $.extend(true, {}, defaultOptions, 
specificOptions);
             var oTable = table.dataTable(mergedOptions);
             <?php
+            // If we're using an Ajax data source then don't offer column 
reordering.
+            // This is a problem at the moment in DataTables because if you 
reorder a column
+            // DataTables doesn't know that the Ajax data is still in the 
original order.
+            // May be fixed in a future release of DataTables
+            ?>
+            if (!specificOptions.sAjaxSource)
+            {
+              var oCR = new ColReorder(oTable, mergedOptions);
+            }
+            <?php
             // Need to re-create the datatable when the browser window is 
resized.  We
             // can't just do a fnDraw() because that does not redraw the Fixed 
Columns
             // properly

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to