Class TreeDropdownField
Dropdown-like field that allows you to select an item from a hierachical AJAX-expandable tree
- Object
-
ViewableData
implements
IteratorAggregate
-
RequestHandler
-
FormField
-
TreeDropdownField
Direct known subclasses
OrderItemField,
SubsitesTreeDropdownField,
TreeDropdownField_Readonly,
TreeMultiselectField,
Widget_TreeDropdownField
Indirect known subclasses
Methods summary
public
|
#
__construct( string $name, string $title = null, sourceObject $sourceObject = 'Group', string $keyField = 'ID', string $labelField = 'Title', string $showSearch = false )
CAVEAT: for search to work properly $labelField must be a database field, or you need to setSearchFunction. |
public
|
#
setTreeBaseID( integer $ID )
Set the ID of the root node of the tree. This defaults to 0 - i.e. displays the whole tree. |
public
|
#
setFilterFunction( callable $callback )
Set a callback used to filter the values of the tree before displaying to the user. |
public
|
#
setSearchFunction( callable $callback )
Set a callback used to search the hierarchy globally, even before applying the filter. |
public
string
|
|
public
string
|
|
public
unknown_type
|
#
filterMarking( mixed $node )
Marking function for the tree, which combines different filters sensibly. If a filter function has been set, that will be called. If the source is a folder, automatically filter folder. And if search text is set, filter on that too. Return true if all applicable conditions are true, false otherwise. |
protected
|
#
populateIDs( )
Populate $this->searchIds with the IDs of the pages matching the searched parameter and their parents. Reverse-constructs the tree starting from the leaves. Initially taken from CMSSiteTreeFilter, but modified with pluggable search function. |
protected
|
#
objectForKey( string|integer $key )
Get the object where the $keyField is equal to a certain value |
public
|
Methods inherited from FormField
FieldHolder(),
LeftTitle(),
Link(),
Message(),
MessageType(),
Name(),
Required(),
RightTitle(),
SmallFieldHolder(),
Title(),
Type(),
Value(),
addExtraAttribute(),
addExtraClass(),
allowHTML5(),
allow_html5(),
attrName(),
attrTitle(),
attrValue(),
createTag(),
dataValue(),
debug(),
describe(),
extraClass(),
fieldHolderTemplates(),
fieldTemplates(),
forTemplate(),
getCustomValidationMessage(),
getExtraClasses(),
getForm(),
getHTML5Attribute(),
getTabIndex(),
getTabIndexHTML(),
hasClass(),
hasData(),
id(),
isComposite(),
isDisabled(),
isReadonly(),
jsValidation(),
name_to_label(),
performDisabledTransformation(),
removeExtraAttribute(),
removeExtraClass(),
rootFieldSet(),
saveInto(),
securityTokenEnabled(),
setAutocomplete(),
setContainerFieldSet(),
setCustomValidationMessage(),
setDisabled(),
setError(),
setFieldHolderTemplate(),
setForm(),
setHTML5Attribute(),
setLeftTitle(),
setName(),
setReadonly(),
setRightTitle(),
setSmallFieldHolderTemplate(),
setTabIndex(),
setTemplate(),
setTitle(),
setValue(),
smallFieldHolderTemplates(),
transform(),
useHTML5(),
use_html5(),
validate()
Methods inherited from RequestHandler
allowedActions(),
checkAccessAction(),
getRequest(),
handleRequest(),
hasAction(),
httpError()
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
defineMethods(),
escapeTypeForField(),
getField(),
getIterator(),
getSecurityID(),
getXMLValues(),
hasField(),
hasValue(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj(),
setField()
Methods inherited from Object
__call(),
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
create(),
createMethod(),
create_from_string(),
exists(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Properties summary
public static
array
|
$url_handlers |
#
The default URL handling rules. This specifies that the next component of the URL corresponds to a method to be called on this RequestHandlingData object. |
public static
array
|
$allowed_actions |
#
Define a list of action handling methods that are allowed to be called directly by URLs. The variable should be an array of action names. This sample shows the different values that it can contain: |
protected
mixed
|
$keyField | |
protected
mixed
|
$labelField | |
protected
mixed
|
$filterCallback | |
protected
mixed
|
$searchCallback | |
protected
integer
|
$baseID | |
protected
mixed
|
$searchIds |
#
Used by field search to leave only the relevant entries |
protected
array
|
$searchExpanded |
Properties inherited from FormField
$autocomplete,
$containerFieldSet,
$customValidationMessage,
$description,
$disabled,
$dontEscape,
$extraAttributes,
$extraClass,
$extraClasses,
$fieldHTML5,
$fieldHolderTemplate,
$form,
$html5Attributes,
$leftTitle,
$message,
$messageType,
$name,
$possible_autocomplete_values,
$readonly,
$rightTitle,
$smallFieldHolderTemplate,
$tabIndex,
$template,
$title,
$use_html5,
$value
Properties inherited from RequestHandler
Properties inherited from ViewableData
$casting,
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems