fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7649] controller: fix 'delete' from contextmenu


From: Sigurd Nes
Subject: [Fmsystem-commits] [7649] controller: fix 'delete' from contextmenu
Date: Mon, 19 Sep 2011 13:44:10 +0000

Revision: 7649
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7649
Author:   sigurdne
Date:     2011-09-19 13:44:09 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
controller: fix 'delete' from contextmenu

Modified Paths:
--------------
    trunk/controller/inc/class.uicommon.inc.php
    trunk/controller/js/yahoo/datatable.js
    trunk/controller/templates/base/datatable.xsl

Modified: trunk/controller/inc/class.uicommon.inc.php
===================================================================
--- trunk/controller/inc/class.uicommon.inc.php 2011-09-19 09:23:52 UTC (rev 
7648)
+++ trunk/controller/inc/class.uicommon.inc.php 2011-09-19 13:44:09 UTC (rev 
7649)
@@ -470,7 +470,8 @@
                        
                        return array(   
                                'ResultSet' => array(
-                                       'totalResultsAvailable' => 
$results['total_records'], 
+                                       'totalResultsAvailable' => 
$results['total_records'],
+                                       'recordsReturned'               => 
count($result['results']),
                                        'startIndex' => $results['start'], 
                                        'sortKey' => $results['sort'], 
                                        'sortDir' => $results['dir'], 

Modified: trunk/controller/js/yahoo/datatable.js
===================================================================
--- trunk/controller/js/yahoo/datatable.js      2011-09-19 09:23:52 UTC (rev 
7648)
+++ trunk/controller/js/yahoo/datatable.js      2011-09-19 13:44:09 UTC (rev 
7649)
@@ -80,6 +80,7 @@
         fields: fields,
         metaFields : {
             totalResultsAvailable: "ResultSet.totalResultsAvailable",
+           // recordsReturned: "ResultSet.recordsReturned",
                        startIndex: 'ResultSet.startIndex',
                        sortKey: 'ResultSet.sortKey',
                        sortDir: 'ResultSet.sortDir'
@@ -460,9 +461,8 @@
        {
                var callback =  {success: function(o){
                                                        message_delete = 
o.responseText.toString().replace("\"","").replace("\"","");
-                                                       
//YAHOO.portico.initializeDataTable()
-                                                       
YAHOO.portico.update_datatable()
                                                        alert(message_delete);
+                                                       
document.getElementById('update_table_dummy').submit();//update table
                                                        },
                                                        failure: 
function(o){window.alert('Server or your connection is dead.')},
                                                        timeout: 10000
@@ -476,54 +476,4 @@
 */
 
 
-       //Not working...
-       
-       YAHOO.portico.update_datatable = function()
-       {
-alert('YAHOO.portico.update_datatable');
-               //delete values of datatable
-               myDataTable.getRecordSet().reset();
-
-
-               //reset total records always to zero
-               pag.setTotalRecords(0,true);
-
-               //change PaginatorĊ½s configuration.
-               if(path_values.allrows == 1 )
-               {
-                       pag.set("rowsPerPage",ResultSet.totalResultsAvailable)
-               }
-
-               //obtain records of the last DS and add to datatable
-               var record = values_ds.records;
-               var newTotalRecords = values_ds.totalRecords;
-
-               if(record.length)
-               {
-                       myDataTable.addRows(record);
-               }
-               else
-               {
-                       myDataTable.render();
-               }
-
-               //update paginator with news values
-               pag.setTotalRecords(newTotalRecords,true);
-
-               //update globals variables for pagination
-               myrowsPerPage = values_ds.recordsReturned;
-               mytotalRows = values_ds.totalRecords;
-
-               //update combo box pagination
-               pag.set('rowsPerPageOptions',[myrowsPerPage,mytotalRows]);
-
-               pag.setPage(parseInt(values_ds.currentPage),true); //true no 
fuerza un recarge solo cambia el paginator
-
-               //update "sortedBy" values
-
-               (values_ds.dir == "asc")? dir_ds = 
YAHOO.widget.DataTable.CLASS_ASC : dir_ds = YAHOO.widget.DataTable.CLASS_DESC;
-               myDataTable.set("sortedBy",{key:values_ds.sort,dir:dir_ds});
-       }
-
-
 YAHOO.util.Event.addListener(window, "load", 
YAHOO.portico.initializeDataTable);

Modified: trunk/controller/templates/base/datatable.xsl
===================================================================
--- trunk/controller/templates/base/datatable.xsl       2011-09-19 09:23:52 UTC 
(rev 7648)
+++ trunk/controller/templates/base/datatable.xsl       2011-09-19 13:44:09 UTC 
(rev 7649)
@@ -90,8 +90,10 @@
                                                                
oAC.itemSelectEvent.subscribe(itemSelectCallback);
                                                        }
 
-                                                       
YAHOO.util.Event.addBlurListener('filter_'+name+'_name', function() {
-                                                               if 
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "") {
+                                                       
YAHOO.util.Event.addBlurListener('filter_'+name+'_name', function()
+                                                       {
+                                                               if 
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "")
+                                                               {
                                                                        
YAHOO.util.Dom.get('filter_'+name+'_id').value = "";
                                                                        if 
(onClearSelectionCallback) {
                                                                                
onClearSelectionCallback();
@@ -99,8 +101,10 @@
                                                                }
                                                        });
 
-                                                       
YAHOO.portico.addPreSerializeQueryFormListener(function(form) {
-                                                               if 
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "") {
+                                                       
YAHOO.portico.addPreSerializeQueryFormListener(function(form)
+                                                       {
+                                                               if 
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "")
+                                                               {
                                                                        
YAHOO.util.Dom.get('filter_'+name+'_id').value = "";
                                                                } 
                                                        });
@@ -196,6 +200,10 @@
                </xsl:attribute>
         <xsl:apply-templates select="toolbar"/>
        </form>
+
+       <form id="update_table_dummy" method='POST' action='' >
+       </form>
+
 </xsl:template>
 
 <xsl:template match="datatable">




reply via email to

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