7938 Posts in 1466 Topics by 943 members
|Go to End|
13 January 2010 at 6:46am Last edited: 13 January 2010 6:48am
i just found that SimpleTreeDropdownField doesn't have a 'setTreeBaseID' method (as the 'regular' TreeDropdownField has - see http://api.silverstripe.org/forms/fields-relational/TreeDropdownField.html#$treeBaseID).
i had a glance at the code and found a quick way to add this functionality:
- just add one more param ($baseID) to the constructor:
function __construct($name, $title = "", $sourceClass = "SiteTree", $value = "", $form = null, $emptyString = null, $baseID = 0)
- then, use it in the 'getHierarchy' call:
parent::__construct($name, $title, $this->getHierarchy($baseID), $value, $form, $emptyString);
that's it - maybe you want to add this in svn, unclecheese?
13 January 2010 at 7:04am
Awesome.. thanks. Lots of new stuff will be coming in soon, so I'll roll this in, too.
22 June 2010 at 3:54am
just needed this again in a current project and couldn't find it in the source (r402), maybe you just forgot?
2 February 2012 at 5:46am
back again: it's in now
don't know as of which revision, but thanks anyway!
|Go to Top|