Skip to content
This repository
Browse code

fixed: cdd not working if no dbjoin element found on the page

  • Loading branch information...
commit 49143770e5179f930b7acd45dc79d65a56c615d9 1 parent 051822f
Rob Clayburn authored May 09, 2013
20  plugins/fabrik_element/cascadingdropdown/cascadingdropdown.php
@@ -92,6 +92,26 @@ public function elementJavascript($repeatCounter)
92 92
 	}
93 93
 
94 94
 	/**
  95
+	 * Get the class to manage the form element
  96
+	 * if a plugin class requires to load another elements class (eg user for dbjoin then it should
  97
+	 * call FabrikModelElement::formJavascriptClass('plugins/fabrik_element/databasejoin/databasejoin.js', true);
  98
+	 * to ensure that the file is loaded only once
  99
+	 *
  100
+	 * @param   array   &$srcs   Scripts previously loaded (load order is important as we are loading via head.js
  101
+	 * and in ie these load async. So if you this class extends another you need to insert its location in $srcs above the
  102
+	 * current file
  103
+	 * @param   string  $script  Script to load once class has loaded
  104
+	 *
  105
+	 * @return void
  106
+	 */
  107
+
  108
+	public function formJavascriptClass(&$srcs, $script = '')
  109
+	{
  110
+		plgFabrik_Element::formJavascriptClass($srcs, 'plugins/fabrik_element/databasejoin/databasejoin.js');
  111
+		parent::formJavascriptClass($srcs, $script);
  112
+	}
  113
+
  114
+	/**
95 115
 	 * Get the field name to use as the column that contains the join's label data
96 116
 	 *
97 117
 	 * @param   bool  $useStep  use step in element name

0 notes on commit 4914377

Please sign in to comment.
Something went wrong with that request. Please try again.