Skip to content

Commit

Permalink
fixed: cdd not working if no dbjoin element found on the page
Browse files Browse the repository at this point in the history
  • Loading branch information
pollen8 committed May 9, 2013
1 parent 051822f commit 4914377
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions plugins/fabrik_element/cascadingdropdown/cascadingdropdown.php
Expand Up @@ -91,6 +91,26 @@ public function elementJavascript($repeatCounter)
return array('FbCascadingdropdown', $id, $opts);
}

/**
* Get the class to manage the form element
* if a plugin class requires to load another elements class (eg user for dbjoin then it should
* call FabrikModelElement::formJavascriptClass('plugins/fabrik_element/databasejoin/databasejoin.js', true);
* to ensure that the file is loaded only once
*
* @param array &$srcs Scripts previously loaded (load order is important as we are loading via head.js
* and in ie these load async. So if you this class extends another you need to insert its location in $srcs above the
* current file
* @param string $script Script to load once class has loaded
*
* @return void
*/

public function formJavascriptClass(&$srcs, $script = '')
{
plgFabrik_Element::formJavascriptClass($srcs, 'plugins/fabrik_element/databasejoin/databasejoin.js');
parent::formJavascriptClass($srcs, $script);
}

/**
* Get the field name to use as the column that contains the join's label data
*
Expand Down

0 comments on commit 4914377

Please sign in to comment.