fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [14893] initial sorting and preserve filter


From: Sigurd Nes
Subject: [Fmsystem-commits] [14893] initial sorting and preserve filter
Date: Wed, 06 Apr 2016 13:17:00 +0000

Revision: 14893
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14893
Author:   sigurdne
Date:     2016-04-06 13:16:59 +0000 (Wed, 06 Apr 2016)
Log Message:
-----------
initial sorting and preserve filter

Modified Paths:
--------------
    trunk/phpgwapi/templates/base/datatable_jquery.xsl

Modified: trunk/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- trunk/phpgwapi/templates/base/datatable_jquery.xsl  2016-04-06 13:16:01 UTC 
(rev 14892)
+++ trunk/phpgwapi/templates/base/datatable_jquery.xsl  2016-04-06 13:16:59 UTC 
(rev 14893)
@@ -334,7 +334,7 @@
 <xsl:template match="form/list_actions">
        <form id="list_actions_form" method="POST">
                <!-- Form action is set by javascript listener -->
-               <div id="list_actions" class='yui-skin-sam'>
+               <div id="list_actions">
                        <table cellpadding="0" cellspacing="0">
                                <tr>
                                        <xsl:for-each select="item">
@@ -578,6 +578,11 @@
                var oTable = null;
                $(document).ready(function() {
                var ajax_url = '<xsl:value-of select="source"/>';
+               var order_def = [];
+               <xsl:if test="sorted_by/key">
+                       order_def.push([<xsl:value-of select="sorted_by/key"/>, 
'<xsl:value-of select="sorted_by/dir"/>']);
+               </xsl:if>
+
                var download_url = '<xsl:value-of select="download"/>';
                var exclude_colvis = [];
                var editor_cols = [];
@@ -886,14 +891,16 @@
                                }
                        }
 
-                       var order_def = [];
-                       for(i=0;i < JqueryPortico.columns.length;i++)
+                       if(order_def.length == 0)
                        {
-                               if (JqueryPortico.columns[i]['orderable'] === 
true && typeof(JqueryPortico.columns[i]['dir']) != 'undefined')
+                               for(i=0;i < JqueryPortico.columns.length;i++)
                                {
-                                       var dir = 
JqueryPortico.columns[i]['dir'] || "desc";
-                                       order_def.push([i, dir]);
-                                       break;
+                                       if 
(JqueryPortico.columns[i]['orderable'] === true && 
typeof(JqueryPortico.columns[i]['dir']) != 'undefined')
+                                       {
+                                               var dir = 
JqueryPortico.columns[i]['dir'] || "desc";
+                                               order_def.push([i, dir]);
+                                               break;
+                                       }
                                }
                        }
 
@@ -919,7 +926,7 @@
                         * Find and assign actions to filters
                         */
                        var oControls = 
$('.dtable_custom_controls:first').find(':input[name]');
-
+//console.log(oControls);
                        oTable = $('#datatable-container').dataTable({
                                paginate:               disablePagination ? 
false : true,
                                processing:             true,
@@ -976,8 +983,8 @@
                                                        params = {}
                                                }
                                        }
-                                       console.log(oData);
-                                       console.log(params);
+                               //      console.log(oData);
+                               //      console.log(params);
                                        oControls.each(function() {
                                                var oControl = $(this);
                                                $.each(params, function(index, 
value) {
@@ -1016,7 +1023,21 @@
                                                        
active_filters_html.push(i);
                                                }
                                        }
+//                                     console.log(oControls);
+                                       oControls.each(function()
+                                       {
+                                               if ( $(this).attr('name') )
+                                               {
+                                                       value = 
$(this).val().replace('"', '"');
+                                                       aoData[ 
$(this).attr('name') ] = value;
+                                               }
 
+//                                             if(value && value !=0 )
+//                                             {
+//                                                     
active_filters_html.push($(this).attr('name'));
+//                                             }
+                                       });
+
                                        if(active_filters_html.length > 0)
                                        {
                                                
$('#active_filters').html("Aktive filter: " + active_filters_html.join(', '));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]