MidCOM svn: r12663 - trunk/midcom/midcom.helper.datamanager2/widget

w_i midcom-commits at lists.midgard-project.org
Thu Oct 4 19:42:22 CEST 2007


Author: w_i
Date: Thu Oct  4 19:42:21 2007
New Revision: 12663
URL: http://trac.midgard-project.org/software/changeset/12663

Log:
Added possibility to add javascript events to select menus

Modified:
   trunk/midcom/midcom.helper.datamanager2/widget/select.php

Modified: trunk/midcom/midcom.helper.datamanager2/widget/select.php
==============================================================================
--- trunk/midcom/midcom.helper.datamanager2/widget/select.php	(original)
+++ trunk/midcom/midcom.helper.datamanager2/widget/select.php	Thu Oct  4 19:42:21 2007
@@ -56,6 +56,14 @@
      */
     var $_select_element = null;
 
+	/**
+	 * JS actions bound to widget
+	 *
+	 * @var array
+	 */
+
+	var $jsevents = null;
+
     /**
      * The initialization event handler verifies the correct type.
      *
@@ -106,6 +114,15 @@
             'class' => ($this->_type->allow_multiple) ? 'list' : 'dropdown',
             'id'    => "{$this->_namespace}{$this->name}",
         );
+        
+        if (is_array($this->jsevents) && count($this->jsevents))
+        {
+            foreach ($this->jsevents as $event => $action)
+            {
+                $select_attributes[$event] = $action;
+            }
+        }
+        
         $select_element =& HTML_QuickForm::createElement('select', $this->name, $this->_translate($this->_field['title']),
             $this->_all_elements, $select_attributes);
         $select_element->setMultiple($this->_type->allow_multiple);


More information about the midcom-commits mailing list