Class TableListField
Form field that embeds a list into a form, such as a member list or a file list.
All get variables are namespaced in the format ctf[MyFieldName][MyParameter] to avoid collisions when multiple TableListFields are present in a form.
- Object
-
ViewableData
implements
IteratorAggregate
-
RequestHandler
-
FormField
-
TableListField
Direct known subclasses
CartTableListField,
ComplexTableField,
FileList,
SubpageListField,
SubsiteAgnosticTableListField,
TableField
Indirect known subclasses
AssetManager,
AssetTableField,
HasOneComplexTableField,
HasOneDataObjectManager,
HasOneFileDataObjectManager,
ImageAssetManager,
ImageDataObjectManager,
ManyManyComplexTableField,
ManyManyDataObjectManager,
ManyManyFileDataObjectManager,
Mediaweb3DPageFiles_Manager,
MediawebPageFiles_Manager,
CommentTableField,
MediawebPagePhoto_Manager,
MediawebPageTexture_Manager,
MemberTableField,
PhotoAlbumManager,
VideoManager,
DataObjectManager,
DocumentPageFiles_Manager,
FileComplexTableField,
FileDataObjectManager,
HasManyComplexTableField,
HasManyDataObjectManager,
HasManyFileDataObjectManager
Param: $name string The fieldname
Param: $sourceClass string The source class of this field
Param: $fieldList array An array of field headings of Fieldname => Heading Text (eg. heading1)
Param: $sourceFilter string The filter field you wish to limit the objects by (eg. parentID)
Param: $sourceSort string
Param: $sourceJoin string
Located at sapphire/forms/TableListField.php
Methods summary
public
|
#
__construct(
Create a new field. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
FieldHolder( )
Returns a "Field Holder" for this field - used by templates. Forms are constructed from by concatenating a number of these field holders. The default field holder is a label and form field inside a paragraph tag. |
public
|
|
public
|
|
public
boolean
|
#
isFieldSortable( string $fieldName )
Determines if a field is "sortable". If the field is generated by a custom getter, we can't sort on it without generating all objects first (which would be a huge performance impact). |
public
|
|
public
|
#
setCustomQuery(
Provide a custom query to compute sourceItems. This is the preferred way to using {@setSourceItems}, because we can still paginate. Caution: Other parameters such as {@sourceFilter} will be ignored. Please use this only as a fallback for really complex queries (e.g. involving HAVING and GROUPBY). |
public
|
|
public
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
#
setClick_AjaxLoad( mixed $urlBase, mixed $formID )
Configure this table to load content into a subform via ajax |
public
|
|
public
|
|
public
String
|
|
public
|
#
addSummary( mixed $summaryTitle, mixed $summaryFieldList )
Can utilize some built-in summary-functions, with optional casting. Currently supported:
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
boolean
|
|
public
|
|
public
array
|
|
public
|
#
setShowPagination( mixed $bool )
################################# |
public
boolean
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
array
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
String
|
#
filterString( )
Compile all request-parameters for search and pagination (except the actual list-positions) as a query-string. |
public
|
#
setFieldListCsv( mixed $fields )
################################# |
public
|
|
public
|
|
public
|
|
public
|
#
export( )
Exports a given set of comma-separated IDs (from a previous search-query,
stored in a HiddenField). Uses {$csv_columns} if present, and falls back to
{$result_columns}. We move the most filedata generation code to the function
|
public
|
|
public
|
#
ExportLink( )
We need to instanciate this button manually as a normal button has no means of adding inline onclick-behaviour. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
String
|
|
public
|
|
public
|
|
public
|
|
public
mixed
|
|
public
|
|
public
|
|
public
|
|
public static
array
|
#
permissions_for_object( string $class, numeric $id = null )
Helper method to determine permissions for a scaffolded TableListField (or
subclasses) - currently used in |
public
|
|
public
|
#
setHighlightConditions( mixed $conditions )
######################### |
Methods inherited from FormField
Field(),
LeftTitle(),
Link(),
Message(),
MessageType(),
Required(),
RightTitle(),
SmallFieldHolder(),
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(),
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
protected
mixed
|
$cachedSourceItems |
#
DataObjectSet Prevent {@sourceItems()} from being called multiple times. |
protected
mixed
|
$sourceClass | |
protected
string
|
$sourceFilter | |
protected
string
|
$sourceSort | |
protected
array
|
$sourceJoin | |
protected
mixed
|
$fieldList | |
protected
boolean
|
$disableSorting | |
protected
mixed
|
$fieldListCsv |
#
array |
protected
mixed
|
$clickAction | |
public
boolean
|
$IsReadOnly | |
protected
mixed
|
$methodName |
#
Called method (needs to be retained for AddMode()) |
protected
mixed
|
$summaryFieldList |
#
array Shows a row which summarizes the contents of a column by a predefined Javascript-function |
protected
mixed
|
$summaryTitle |
#
string The title which will be shown in the first column of the summary-row. Accordingly, the first column can't be used for summarizing. |
protected
string
|
$template |
#
string Template-Overrides |
public
string
|
$itemClass |
#
string Class name for each item/row |
public
boolean
|
$Markable |
#
Do we use checkboxes to mark records, or delete them one by one? |
public
mixed
|
$MarkableTitle | |
protected
mixed
|
$readOnly |
#
boolean Deprecated, please use $permssions instead |
protected
array
|
$permissions |
#
array Influence output without having to subclass the template. See $actions for adding your custom actions/permissions. |
public
array
|
$actions |
#
array Action that can be performed on a single row-entry. Has to correspond
to a method in a TableListField-class (or subclass). Actions can be disabled
through $permissions. Format (key is used for the methodname and CSS-class):
array( |
public
string
|
$defaultAction |
#
String Action being executed when clicking on table-row (defaults to "show"). Mostly needed in ComplexTableField-subclass. |
protected
mixed
|
$customQuery |
#
Specify custom query, e.g. for complicated having/groupby-constructs. Caution: TableListField automatically selects the ID from the {@sourceClass}, because it relies on this information e.g. in saving a TableField. Please use a custom select if you want to filter for other IDs in joined tables: $query->select[] = "MyJoinedTable.ID AS MyJoinedTableID" |
protected
mixed
|
$customCsvQuery |
#
Query for CSV-export (might need different fields or further filtering) |
protected
mixed
|
$customSourceItems |
#
DataObjectSet Use the manual setting of a result-set only as a last-resort for sets which can't be resolved in a single query. |
protected
string
|
$csvSeparator |
#
Character to seperate exported columns in the CSV file |
protected
boolean
|
$csvHasHeader | |
public
array
|
$csvFieldEscape |
#
Specify custom escape for the fields. array("\""=>"\"\"","\r"=>"", "\r\n"=>"", "\n"=>"") |
protected
integer
|
$totalCount |
#
Shows total count regardless or pagination |
protected
boolean
|
$showPagination |
#
Trigger pagination |
public
string
|
$paginationBaseLink |
#
Override the |
protected
integer
|
$pageSize |
#
Number of items to show on a single page (needed for pagination) |
public
array
|
$highlightConditions |
#
Definitions for highlighting table-rows with a specific class. You can use all column-names in the result of a query. Use in combination with {@setCustomQuery} to select custom properties and joined objects. Example: array( |
public
array
|
$fieldCasting |
#
Specify castings with fieldname as the key, and the desired casting as value. Example: array("MyCustomDate"=>"Date","MyShortText"=>"Text->FirstSentence") |
public
array
|
$fieldFormatting | |
public
array
|
$csvFieldFormatting | |
public
string
|
$exportButtonLabel | |
public
string
|
$groupByField |
#
$groupByField Used to group by a specific column in the DataObject and create partial summaries. |
protected
array
|
$extraLinkParams | |
protected
mixed
|
$__cachedQuery | |
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. |
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,
$title,
$use_html5,
$value
Properties inherited from RequestHandler
$allowed_actions,
$brokenOnConstruct,
$request
Properties inherited from ViewableData
$casting,
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems