Backend\Widgets\ListStructure

Extends
Implements
  • October\Contracts\Element\ListElement

Public Properties

public bool $useStructure

useStructure display parent/child relationships in the list.

public bool $showTree

showTree will display the tree structure

public bool $treeExpanded

treeExpanded will expand the tree nodes by default.

public bool $showReorder

showReorder allows the user to reorder the records.

public bool $includeSortOrders

includeSortOrders specifies if "sort_orders" should be included in postback.

public bool $includeReferencePool

includeReferencePool should be used when sorting within subset of records. For example, sorting with pagination.

public int|null $maxDepth

maxDepth defines the maximum levels allowed for reordering.

public bool $dragRow

dragRow allows dragging the entire row in addition to the reorder handle.

Show inherited public properties

Inherited Public Properties

Protected Properties

protected array $permissions

permissions needed to modify the structure.

Show inherited protected properties

Inherited Protected Properties


Public Methods

public __construct()

public __construct(
    Backend\Classes\Controller $controller,
    array $configuration = []
): void

__construct the widget

public init()

public init(): void

init the widget, called by the constructor and free from its parameters.

public isTreeNodeExpanded()

public isTreeNodeExpanded(Model $node): bool 

isTreeNodeExpanded checks if a node (model) is expanded in the session.

public onReorder()

public onReorder(): void

public onShowStructure()

public onShowStructure(): void

public onSort()

public onSort(): void

onSort AJAX handler for sorting the list.

public onToggleTreeNode()

public onToggleTreeNode(): void

onToggleTreeNode sets a node (model) to an expanded or collapsed state, stored in the session, then renders the list again.

public prepareVars()

public prepareVars(): void

prepareVars for display

public setSearchTerm()

public setSearchTerm($term, $resetState = false): void

setSearchTerm will disable the structure if a value is supplied.

public useSortOrdering()

public useSortOrdering(): bool 

public validateTree()

public validateTree(): void

validateTree validates the model and settings if useStructure is used

Show inherited public methods

Inherited Public Methods

Protected Methods

protected disableStructure()

protected disableStructure(): void

disableStructure toggles the settings to completely disable the structure

protected enableStructure()

protected enableStructure(): void

enableStructure reverts disableStructure

protected getIndentSize()

protected getIndentSize(): int 

getIndentSize returns the size increment of indentation

protected getIndentStartSize()

protected getIndentStartSize($treeLevel): int 

getIndentStartSize is used to pad each row based on its tree level

protected getIndentTreeStatus()

protected getIndentTreeStatus($records): bool 

getIndentTreeStatus checks if the collapse UI should be shown based on if any records have children.

protected getRecords()

protected getRecords(): Collection 

getRecords returns all the records from the supplied model, after filtering

protected getTotalColumns()

protected getTotalColumns(): void

getTotalColumns calculates the total columns used in the list, including checkboxes and other additions.

protected hasStructurePermission()

protected hasStructurePermission(): bool 

hasStructurePermission checks if the user has permissions to modify the structure.

protected loadAssets()

protected loadAssets(): void

{{inherit}}

protected reorderForNestedTree()

protected reorderForNestedTree($item): void

protected reorderForSimpleTree()

protected reorderForSimpleTree($item): void

protected reorderForSortable()

protected reorderForSortable($item): void

protected useSorting()

protected useSorting(): bool 

Show inherited protected methods

Inherited Protected Methods