7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » setTreeBaseID for SimpleTreeDropdownField
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1218 Views |
-
setTreeBaseID for SimpleTreeDropdownField

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?
-
Re: setTreeBaseID for SimpleTreeDropdownField

13 January 2010 at 7:04am
Awesome.. thanks. Lots of new stuff will be coming in soon, so I'll roll this in, too.
-
Re: setTreeBaseID for SimpleTreeDropdownField

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?
-
Re: setTreeBaseID for SimpleTreeDropdownField

2 February 2012 at 5:46am
back again: it's in now
don't know as of which revision, but thanks anyway!
| 1218 Views | ||
|
Page:
1
|
Go to Top |

