TreeGrid

A TreeGrid, a Tree combined with a Grid. Must be configured with exactly one TreeColumn (type: tree), but can also have an arbitrary number of other columns. Most features that can be used with Grid also works with TreeGrid, except the Group feature.

Tree grid
//<code-header>
fiddle.title = 'Tree grid';
//</code-header>
targetElement.innerHTML = '<p>A basic TreeGrid with minimal configuration:</p>';

const tree = new TreeGrid({
    appendTo : targetElement,

    height : 400,

    data : [
        {
            id       : 1,
            name     : 'ABBA',
            iconCls  : 'b-icon fa-users',
            born     : null,
            expanded : true,
            children : [
                { id : 11, name : 'Anni-Frid', born : 1945, iconCls : 'b-icon fa-user' },
                { id : 12, name : 'Bjorn', born : 1945, iconCls : 'b-icon fa-user' },
                { id : 13, name : 'Benny', born : 1946, iconCls : 'b-icon fa-user' },
                { id : 14, name : 'Agnetha', born : 1950, iconCls : 'b-icon fa-user' }
            ]
        },
        {
            id       : 2,
            name     : 'Roxette',
            iconCls  : 'b-icon fa-users',
            born     : null,
            children : [
                { id : 21, name : 'Per', born : 1959, iconCls : 'b-icon fa-user' },
                { id : 22, name : 'Marie', born : 1958, iconCls : 'b-icon fa-user' }
            ]
        }
    ],

    columns : [
        { type : 'tree', field : 'name', text : 'Name', flex : 1 },
        { type : 'number', field : 'born', text : 'Born', flex : 1, format : null  }
    ]
});

Using a Store configured with lazyLoad is not supported in TreeGrid.

Configs

157

Common

The store instance or config object that holds the records to be displayed by this TreeGrid. If assigning a store instance, it must be configured with tree: true.

A store will be created if none is specified.

columnsGridBase
dataGridBase
emptyTextGridBase
featuresGridBase
keyMapGridBase
listenersEvents
rowHeightGridBase

Accessibility

ariaLabelWidget

Content

bbarPanel
defaultsContainer
footerPanel
headerPanel
itemsContainer
lazyItemsContainer
namedItemsContainer
stripsPanel
tbarPanel
textContentContainer
toolsPanel

CSS

bodyClsPanel
borderContainer
clsWidget
colorWidget
htmlClsWidget
itemClsContainer
styleWidget
uiPanel

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget

Float & align

alignWidget
anchorWidget
centeredWidget
draggableWidget
floatingWidget
xWidget
yWidget

Layout

alignSelfWidget
autoHeightGridBase
dockWidget
flexWidget
getRowHeightGridBase
heightWidget
hiddenWidget
hideWhenEmptyContainer
layoutContainer
layoutStyleContainer
marginWidget
maxHeightWidget
maxWidthWidget
minHeightGridBase
minWidthWidget
textAlignWidget
weightWidget
widthWidget

Masking

loadMaskLoadMaskable
loadMaskDefaultsLoadMaskable
loadMaskErrorLoadMaskable
syncMaskLoadMaskable

misc

tabBarItemsContainer

Misc

cellEllipsisGridBase
columnLinesGridBase
dataFieldWidget
destroyStoreGridBase
disabledWidget
enableStickyGridBase
enableUndoRedoKeysGridElementEvents
hideFootersGridBase
hideHeadersGridBase
hoverClsGridElementEvents
iconPanel
localeClassLocalizable
localizableLocalizable
longPressTimeGridElementEvents
maskDefaultsGridBase
maskedWidget
ownerWidget
pluginsPluggable
readOnlyGridBase
refWidget
responsiveLevelsGridResponsive
rippleWidget
rowLinesGridBase
showDirtyGridBase
tabWidget
titlePanel
tooltipWidget

Other

columnWidget
defaultFocusContainer
drawerPanel
labelPositionContainer
renditionContainer
rtlRTL
spanWidget
stateSettingsGridState
transitionGridBase

Record

recordContainer

Scrolling

scrollableGridBase

Selection

selectionModeGridSelection

State

stateIdState

Tree

Properties

139

Common

columnsGridBase
dataGridBase
emptyTextGridBase
featuresGridFeatures
rowHeightGridBase
storeGridBase
subGridsGridSubGrids

Class hierarchy

isTreeGrid: Boolean= truereadonly
Identifies an object as an instance of TreeGrid class, or subclass thereof.
isTreeGrid: Boolean= truereadonlystatic
Identifies an object as an instance of TreeGrid class, or subclass thereof.
isContainerContainer
isDelayableDelayable
isEventsEvents
isGridGrid
isGridBaseGridBase
isGridElementEventsGridElementEvents
isGridFeaturesGridFeatures
isGridResponsiveGridResponsive
isGridSelectionGridSelection
isGridStateGridState
isGridSubGridsGridSubGrids
isKeyMapKeyMap
isLoadMaskableLoadMaskable
isLocalizableLocalizable
isPanelPanel
isPluggablePluggable
isStateState
isToolableToolable
isWidgetWidget

Accessibility

keyMapKeyMap

Content

bbarPanel
tbarPanel

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Layout

alignSelfWidget
bodyHeightGridBase
flexWidget
footerHeightGridBase
headerHeightGridBase
heightWidget
layoutContainer
layoutStyleContainer
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
widthWidget

Lifecycle

configBase

Misc

cellEllipsisGridBase
cellInfoWidget
columnLinesGridBase
disabledWidget
enableUndoRedoKeysGridElementEvents
hideFootersGridBase
hideHeadersGridBase
hoveredCellGridElementEvents
localeHelperLocalizable
localeManagerLocalizable
longPressTimeGridElementEvents
pluginsPluggable
readOnlyGridBase
refWidget
responsiveLevelGridResponsive
rowLinesGridBase
tabWidget
titlePanel
tooltipWidget

Other

$namestaticWidget
columnWidget
firstItemContainer
hasChangesContainer
isValidContainer
itemsContainer
labelPositionContainer
lastItemContainer
renditionContainer
rtlRTL
spanWidget
stateSettingsGridState
toolsPanel
transitionGridBase
typestaticWidget
valuesContainer

Record

recordContainer

Rows

Scrolling

Selection

selectedCellGridSelection
selectedCellsGridSelection
selectedRecordGridSelection
selectedRecordsGridSelection
selectedRowsGridSelection
selectionModeGridSelection

State

stateGridState

Tree

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget
widgetMapContainer

Functions

128

Feature shortcuts

Collapse a single node.

ParameterTypeDescription
idOrRecordString | Number | Model

Record (the node itself) or id of a node to collapse

Expand a single node.

ParameterTypeDescription
idOrRecordString | Number | Model

Record (the node itself) or id of a node to expand

Expands parent nodes to make this node "visible".

ParameterTypeDescription
idOrRecordString | Number | Model

Record (the node itself) or id of a node

Collapse an expanded node or expand a collapsed. Optionally forcing a certain state.

ParameterTypeDescription
idOrRecordString | Number | Model

Record (the node itself) or id of a node to toggle

collapseBoolean

Force collapse (true) or expand (false)

skipRefreshBoolean

Set to true to not refresh rows (if calling in batch)

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Getters

getCellGridBase

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Misc

addPluginsPluggable
attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
getPluginPluggable
hasFeatureGridFeatures
hasPluginPluggable
isOfTypeNamestaticBase
maskBodyGridBase
mixinstaticBase
optionalLstaticLocalizable
unmaskBodyGridBase

Other

addContainer
composeWidget
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
getAtContainer
getWidgetByIdContainer
insertContainer
LstaticLocalizable
maskWidget
onEvents
recomposeWidget
relayAllEvents
removeContainer
removeAllContainer
resetValuesContainer
setValuesContainer
triggerEvents
unEvents
unmaskWidget

Rendering

refreshRowGridBase
refreshRowsGridBase
renderRowsGridBase

Rows

getRowForGridBase

Scrolling

scrollToTopGridBase
storeScrollGridBase

Selection

deselectAllGridSelection
deselectCellGridSelection
deselectCellsGridSelection
deselectRowGridSelection
deselectRowsGridSelection
isCellSelectedGridSelection
isSelectableGridSelection
isSelectedGridSelection
selectAllGridSelection
selectCellGridSelection
selectCellRangeGridSelection
selectCellsGridSelection
selectRangeGridSelection
selectRowGridSelection
selectRowsGridSelection

State

SubGrid

getSubGridGridSubGrids

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

46
catchAllEvents
cellClickGridElementEvents
cellContextMenuGridElementEvents
cellDblClickGridElementEvents
cellMouseEnterGridElementEvents
cellMouseLeaveGridElementEvents
cellMouseOutGridElementEvents
cellMouseOverGridElementEvents
dataChangeGridBase
destroyEvents
dragSelectingGridSelection
expandPanel
focusInWidget
focusOutWidget
headerClickGridElementEvents
hideWidget
mouseOutGridElementEvents
mouseOverGridElementEvents
paintWidget
readOnlyWidget
recomposeWidget
renderRowGridBase
renderRowsGridBase
resizeWidget
responsiveGridResponsive
rowMouseEnterGridElementEvents
rowMouseLeaveGridElementEvents
scrollGridBase
selectionChangeGridSelection
selectionModeChangeGridSelection
showWidget

Event handlers

46
onCellClickGridElementEvents
onCellContextMenuGridElementEvents
onCellDblClickGridElementEvents
onCellMouseEnterGridElementEvents
onCellMouseLeaveGridElementEvents
onCellMouseOutGridElementEvents
onCellMouseOverGridElementEvents
onDataChangeGridBase
onDestroyEvents
onDragSelectingGridSelection
onFocusInWidget
onHeaderClickGridElementEvents
onHideWidget
onMouseOutGridElementEvents
onMouseOverGridElementEvents
onPaintWidget
onRenderRowGridBase
onRenderRowsGridBase
onResizeWidget
onResponsiveGridResponsive
onRowMouseEnterGridElementEvents
onRowMouseLeaveGridElementEvents
onScrollGridBase
onSelectionChangeGridSelection
onShowWidget

Typedefs

15

CSS variables

83