fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7692] controller: example normal tab


From: Sigurd Nes
Subject: [Fmsystem-commits] [7692] controller: example normal tab
Date: Tue, 20 Sep 2011 13:27:43 +0000

Revision: 7692
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7692
Author:   sigurdne
Date:     2011-09-20 13:27:43 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
controller: example normal tab

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

Modified: trunk/controller/inc/class.uiexample.inc.php
===================================================================
--- trunk/controller/inc/class.uiexample.inc.php        2011-09-20 12:02:48 UTC 
(rev 7691)
+++ trunk/controller/inc/class.uiexample.inc.php        2011-09-20 13:27:43 UTC 
(rev 7692)
@@ -83,6 +83,7 @@
                                                                'name' => 
'buildings',
                                 'text' => lang('Building').':',
                                 'list' => $this->bo->so->get_buildings(),
+                                                               
'onChangeSelect'=> 'requestWithBuildingFilter',
                                                        ),
                                                        array('type' => 
'filter', 
                                                                'name' => 
'activities',

Modified: trunk/controller/js/yahoo/datatable.js
===================================================================
--- trunk/controller/js/yahoo/datatable.js      2011-09-20 12:02:48 UTC (rev 
7691)
+++ trunk/controller/js/yahoo/datatable.js      2011-09-20 13:27:43 UTC (rev 
7692)
@@ -476,5 +476,19 @@
 *
 */
 
+       this.onChangeSelect = function(type)
+       {
+alert('onChangeSelect');
+               var myselect=document.getElementById("sel_"+ type);
+               for (var i=0; i<myselect.options.length; i++)
+               {
+                       if (myselect.options[i].selected==true)
+                       {
+                               break;
+                       }
+               }
+               eval("path_values." +type +"='"+myselect.options[i].value+"'");
+               execute_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-20 12:02:48 UTC 
(rev 7691)
+++ trunk/controller/templates/base/datatable.xsl       2011-09-20 13:27:43 UTC 
(rev 7692)
@@ -116,7 +116,8 @@
                                <xsl:when test="type = 'filter'">
                                        <td valign="top">
                     <xsl:variable name="name"><xsl:value-of 
select="name"/></xsl:variable>
-                       <select name="{$name}" 
onMouseout="window.status='';return true;">
+                       
+                       <select id="{$name}" name="{$name}" 
onMouseout="window.status='';return true;">
                         <xsl:for-each select="list">
                                <xsl:variable name="id"><xsl:value-of 
select="id"/></xsl:variable>
                                                        <xsl:if test="id = 
'NEW'">
@@ -132,6 +133,34 @@
                         </xsl:for-each>
                        </select>
                     </td>
+                                       <xsl:if test="onChangeSelect">
+                                               <script type="text/javascript"> 
+                                                       
YAHOO.util.Event.onDOMReady(function() {
+                                                       var elementid = 
"<xsl:value-of select="name"/>";
+                                                       <![CDATA[
+                                                               var oElement = 
document.getElementById(elementid);
+                                                               function 
onChangeSelectCallback(e, oElement)
+                                                               {
+                                                                       
YAHOO.portico.dataSourceUrl;
+                                                                       
+                                                                       var 
myselect=document.getElementById(elementid);
+                                                                       for 
(var i=0; i<myselect.options.length; i++)
+                                                                       {
+                                                                               
if (myselect.options[i].selected==true)
+                                                                               
{
+                                                                               
        break;
+                                                                               
}
+                                                                       }
+
+                                                                       strURL 
= YAHOO.portico.dataSourceUrl + '&' + elementid + '=' + 
myselect.options[i].value;
+                                                                       
alert('datatable.xsl::' + strURL);
+                                                                       
//alert("onChangeSelectCallback::Do something");
+                                                               }
+                                                               
YAHOO.util.Event.addListener(oElement, "change", onChangeSelectCallback);
+                                                       ]]>
+                                                       });
+                                               </script>
+                                       </xsl:if>
                                </xsl:when>
                                <xsl:otherwise>
                                        <td valign="top">




reply via email to

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