Implementing Dropdown Tree
The Dropdown Tree component displays hierarchical data in a collapsible tree structure within a dropdown interface. It combines tree navigation with dropdown accessibility, supporting multi-selection via checkboxes, lazy loading for large datasets, comprehensive customization through templates and events, filtering, and full accessibility with RTL and localization support.
When to Use This Skill
Use Dropdown Tree immediately when you need to:
- Display hierarchical data - Show nested categories, organizational structures, file trees, or department hierarchies
- Enable multi-selection - Allow users to select multiple items with checkbox support or keyboard modifiers
- Support lazy loading - Optimize performance with large datasets by loading children on demand
- Customize display - Use templates to format items, headers, footers, selected values, or error states
- Implement filtering - Enable search functionality with configurable filter types (StartsWith, EndsWith, Contains)
- Ensure accessibility - Provide WAI-ARIA compliance, keyboard navigation, and screen reader support
- Support multiple languages - Localize UI with customizable keys and RTL support
- Bind remote data - Integrate with OData, OData V4, Web APIs, or other remote data services
- Handle complex selection logic - Use events, auto-check hierarchy, or selective node disabling
Component Overview
The Dropdown Tree features:
- Hierarchical display: Local (hierarchical/self-referential) and remote data sources with flexible binding
- Multi-selection modes: Checkboxes with auto-check, multi-select with Ctrl/Shift keys, single select (default)
- Flexible templates: Item, value, header, footer, noRecords, and actionFailure templates for custom rendering
- Performance optimization: Lazy loading (load-on-demand) for efficient large dataset handling
- Search & filtering: Built-in filter bar with configurable filter types and case sensitivity options
- Comprehensive events: change, select, dataBound, filtering, beforeOpen, focus, keyPress, and popup events
- Accessibility: Full WAI-ARIA (roles, attributes), keyboard navigation, screen reader support, WCAG 2.2 compliance
- Localization: Multi-language support with 4 customizable keys and locale override
- RTL support: Right-to-left layout rendering
- Tree settings: Advanced configuration (expandOn, autoCheck, loadOnDemand, checkDisabledChildren)
- Field mapping: Flexible data structure support (value, text, child, parentValue, expanded, hasChildren, selectable, iconCss, imageUrl, htmlAttributes)
- Display modes: Default, Delimiter, and Custom modes for selected items
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- Installation and package dependencies (npm install command)
- React/TypeScript project setup (Vite and Create React App)
- Basic component implementation and initialization
- CSS imports and theme configuration
- First render and minimal working example
Data Binding
📄 Read: references/data-binding.md
- Local data binding (hierarchical and self-referential structures)
- Remote data with DataManager and various adaptors (OData, OData V4, WebAPI, URL)
- Field mapping for value, text, child, parentValue, expanded, hasChildren
- Load on demand (lazy loading) for large datasets
- Preventing node selection with selectable field
- Query configuration for remote data services
Checkbox & Multi-Selection
📄 Read: references/checkbox-selection.md
- Enabling checkbox support with
showCheckBox property
- Multi-selection workflow and accessing selected values
- Auto-check hierarchical behavior (parent-child synchronization)
- Select All feature with customizable
selectAllText and unSelectAllText
- Intermediate checkbox states for partial selection
- CheckDisabledChildren behavior for disabled nodes
Templates
📄 Read: references/templates.md
- Item template for custom list item rendering
- Value template for selected display customization
- Header template for static content above items
- Footer template for static content below items
- NoRecords template for empty state handling
- ActionFailure template for error state handling
- CustomTemplate for multi-select display customization
- Template expression syntax and data access patterns
Multi-Selection & Filtering
📄 Read: references/multi-selection-filtering.md
allowMultiSelection property and Ctrl/Shift keyboard interaction
- Display modes: Default, Delimiter, Custom
delimiterChar and mode configuration
allowFiltering and filter bar implementation
- Filter types: StartsWith, EndsWith, Contains
filterBarPlaceholder customization
ignoreCase and ignoreAccent options
Tree Settings & Configuration
📄 Read: references/tree-settings.md
loadOnDemand for lazy loading implementation
autoCheck for hierarchical checkbox synchronization
expandOn behavior (Auto, Click, DblClick, None)
checkDisabledChildren for disabled node handling
- Tree expansion and collapse control
Field Mapping & Custom Data Structures
📄 Read: references/field-mapping.md
- Core fields: value, text, dataSource, child, parentValue
- Node state fields: expanded, hasChildren, selected, selectable
- Display enhancement fields: iconCss, imageUrl, htmlAttributes
- Query and tableName for remote data
- Nested field mapping for hierarchical data
Advanced Features & API Reference
📄 Read: references/advanced-features.md
- Properties (60+ properties with descriptions and examples)
- Methods (getSelectedNodes, getCheckedNodes, setCheckedNodes, etc.)
- Events (change, select, dataBound, filtering, beforeOpen, focus, keyPress, popup)
- Event arguments (EventArgs structures with property descriptions)
- Styling and CSS customization
- Performance optimization techniques
Accessibility & Localization
📄 Read: references/accessibility-localization.md
- WCAG 2.2 and Section 508 compliance standards
- WAI-ARIA attributes and roles (listbox, treeitem, checkbox, group, etc.)
- Keyboard navigation shortcuts (Alt+Down, Arrow keys, Enter, Space, etc.)
- Screen reader and assistive technology support
- Localization keys (noRecordsTemplate, actionFailureTemplate, overflowCountTemplate, totalCountTemplate)
- Culture customization with locale property
- RTL (Right-to-Left) language support with enableRtl
Quick Start
Basic Dropdown Tree with Hierarchical Data
import { DropDownTreeComponent } from '@syncfusion/ej2-react-dropdowns';
import '@syncfusion/ej2-dropdowns/styles/material.css';
function App() {
const data = [
{ id: '1', name: 'Electronics', expanded: true },
{ id: '2', name: 'Laptops', parentId: '1' },
{ id: '3', name: 'Phones', parentId: '1' },
{ id: '4', name: 'Appliances' },
];
return (
<DropDownTreeComponent
id="dropdowntree"
fields={{ dataSource: data, value: 'id', text: 'name', parentValue: 'parentId', hasChildren: 'hasChild' }}
placeholder="Select an item"
/>
);
}
export default App;
With Checkboxes and Auto-Check
<DropDownTreeComponent
id="dropdowntree"
fields={{ dataSource: data, value: 'id', text: 'name', parentValue: 'parentId', hasChildren: 'hasChild' }}
showCheckBox={true}
showSelectAll={true}
treeSettings={{ autoCheck: true }}
placeholder="Select items"
/>
With Filtering
<DropDownTreeComponent
id="dropdowntree"
fields={{ dataSource: data, value: 'id', text: 'name', parentValue: 'parentId' }}
allowFiltering={true}
filterType="Contains"
filterBarPlaceholder="Search items..."
placeholder="Select an item"
/>
With Custom Templates
<DropDownTreeComponent
id="dropdowntree"
fields={{ dataSource: data, value: 'id', text: 'name', parentValue: 'parentId' }}
itemTemplate={(props) => (
<div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
<span>{props.name}</span>
<small style={{ color: '#999' }}>({props.category})</small>
</div>
)}
valueTemplate={(props) => <span>{props.name}</span>}
placeholder="Select item"
/>
Common Patterns
Pattern 1: Self-Referential Data Binding
For flat data structures with parent references:
const data = [
{ id: 1, name: 'Discover Music', hasChild: true, expanded: true },
{ id: 2, pid: 1, name: 'Hot Singles' },
{ id: 3, pid: 1, name: 'Rising Artists' },
{ id: 7, name: 'Sales and Events', hasChild: true },
{ id: 8, pid: 7, name: '100 Albums' },
];
<DropDownTreeComponent
id="dropdowntree"
fields={{
dataSource: data,
value: 'id',
text: 'name',
parentValue: 'pid',
hasChildren: 'hasChild',
}}
/>
Pattern 2: Event Handling for Selection Changes
const handleChange = (args) => {
console.log('Old values:', args.oldValue); // string[]
console.log('New values:', args.value); // string[]
console.log('User interaction:', args.isInteracted); // boolean
};
const handleSelect = (args) => {
console.log('Action:', args.action); // 'select' or 'unselect'
console.log('Item data:', args.itemData); // object
};
<DropDownTreeComponent
id="dropdowntree"
fields={fields}
/>
Pattern 3: Multi-Select with Auto-Check
<DropDownTreeComponent
id="dropdowntree"
fields={fields}
showCheckBox={true}
treeSettings={{ autoCheck: true }}
mode="Default"
delimiterChar=", "
placeholder="Select multiple items"
/>
Pattern 4: Lazy Loading for Large Datasets
const remoteData = new DataManager({
url: 'url',
adaptor: new UrlAdaptor(),
});
<DropDownTreeComponent
id="dropdowntree"
fields={{ dataSource: remoteData, value: 'id', text: 'name', hasChildren: 'hasChild' }}
treeSettings={{ loadOnDemand: true }}
placeholder="Loading..."
/>
Pattern 5: Custom Item Styling with IconCss
const data = [
{ id: 1, name: 'Documents', iconCss: 'e-folder', hasChild: true },
{ id: 2, pid: 1, name: 'Resume.pdf', iconCss: 'e-pdf' },
{ id: 3, pid: 1, name: 'Report.docx', iconCss: 'e-docx' },
];
<DropDownTreeComponent
id="dropdowntree"
fields={{
dataSource: data,
value: 'id',
text: 'name',
iconCss: 'iconCss',
parentValue: 'pid',
hasChildren: 'hasChild',
}}
/>
Pattern 6: RTL & Localization Support
<DropDownTreeComponent
id="dropdowntree"
fields={fields}
enableRtl={true}
locale="ar"
placeholder="اختر عنصرا"
/>
Key Props Overview
| Property |
Type |
Description |
| Core |
|
|
id |
string |
Unique identifier for the component |
fields |
FieldsModel |
Data source and field mapping configuration |
placeholder |
string |
Input placeholder text |
enabled |
boolean |
Enable/disable component (default: true) |
| Selection |
|
|
showCheckBox |
boolean |
Enable checkbox multi-selection (default: false) |
showSelectAll |
boolean |
Show Select All checkbox (default: false) |
selectAllText |
string |
"Select All" label text |
unSelectAllText |
string |
"Unselect All" label text |
allowMultiSelection |
boolean |
Enable multi-selection with Ctrl/Shift keys |
| Templates |
|
|
itemTemplate |
string | Function |
Custom item rendering |
valueTemplate |
string | Function |
Custom selected value display |
headerTemplate |
string | Function |
Custom header content |
footerTemplate |
string | Function |
Custom footer content |
noRecordsTemplate |
string | Function |
Empty state template |
actionFailureTemplate |
string | Function |
Error state template |
| Filtering |
|
|
allowFiltering |
boolean |
Enable search/filter bar (default: false) |
filterType |
TreeFilterType |
Filter type: StartsWith, EndsWith, Contains |
filterBarPlaceholder |
string |
Filter bar placeholder text |
ignoreCase |
boolean |
Case-insensitive filtering (default: true) |
ignoreAccent |
boolean |
Ignore diacritics in filtering |
| Tree Settings |
|
|
treeSettings |
TreeSettingsModel |
Tree behavior configuration (autoCheck, loadOnDemand, expandOn) |
| Display |
|
|
mode |
string |
Display mode: Default, Delimiter, Custom |
delimiterChar |
string |
Delimiter for multi-select (default: ", ") |
customTemplate |
string |
Custom multi-select display template |
| Localization & RTL |
|
|
locale |
string |
Culture code (default: "en") |
enableRtl |
boolean |
Enable Right-to-Left layout |
enablePersistence |
boolean |
Persist state between page reloads |
| Styling |
|
|
cssClass |
string |
CSS class for root and popup |
width |
string | number |
Component width |
popupHeight |
string | number |
Popup height |
htmlAttributes |
object |
HTML attributes for the component |
Decision Guide
Choosing Data Binding:
- Local hierarchical - Nested JSON objects with
child property for small-to-medium datasets
- Local self-referential - Flat arrays with
parentValue field for structured data
- Remote with DataManager - OData/Web API for large datasets, dynamic loading, real-time data
Choosing Selection Mode:
- Single select - Default (no checkboxes, no multi-select), read-only visual selection
- Checkboxes -
showCheckBox={true} for explicit multi-selection
- Multi-select -
allowMultiSelection={true} for Ctrl/Shift keyboard selection
- Auto-check - Combine checkboxes with
treeSettings={{ autoCheck: true }} for hierarchy sync
Choosing Template:
- itemTemplate - Custom formatting per tree item (name + description, icons, badges)
- valueTemplate - Custom display in input field (combined text, formatted values)
- headerTemplate - Static controls above list (instructions, search help, custom controls)
- footerTemplate - Static content below list (count summary, action buttons)
- noRecordsTemplate - Empty state when no data or search yields no results
- actionFailureTemplate - Error message when data fetch fails
When to Use Lazy Loading:
- Large datasets (1000+ items)
- Performance-critical applications
- Data fetched from remote API with pagination
- Hierarchies with many levels
When to Use Filtering:
- Large datasets requiring search
- User-friendly discovery of items
- Reducing cognitive load for selection
Next Steps
- Get started → Read getting-started.md
- Bind data → Read data-binding.md
- Add checkboxes → Read checkbox-selection.md
- Enable filtering → Read multi-selection-filtering.md
- Configure trees → Read tree-settings.md
- Map fields → Read field-mapping.md
- Customize → Read templates.md
- Access APIs → Read advanced-features.md
- Enhance UX → Read accessibility-localization.md
1---
2name: syncfusion-react-dropdown-tree
3description: Implement Syncfusion React Dropdown Tree component for hierarchical data selection with dropdown interaction. Use this when working with multi-select checkboxes, lazy loading, remote OData integration, custom templates, keyboard navigation, RTL support, or localized interfaces. Supports auto-check hierarchy, filtering, tree settings, comprehensive event handling, and full accessibility.
4metadata:
5 author: "Syncfusion Inc"
6 version: "34.1.29"
7 category: "Dropdowns"
8---
9
10# Implementing Dropdown Tree
11
12The Dropdown Tree component displays hierarchical data in a collapsible tree structure within a dropdown interface. It combines tree navigation with dropdown accessibility, supporting multi-selection via checkboxes, lazy loading for large datasets, comprehensive customization through templates and events, filtering, and full accessibility with RTL and localization support.
13
14## When to Use This Skill
15
16Use Dropdown Tree **immediately** when you need to:
17
18- **Display hierarchical data** - Show nested categories, organizational structures, file trees, or department hierarchies
19- **Enable multi-selection** - Allow users to select multiple items with checkbox support or keyboard modifiers
20- **Support lazy loading** - Optimize performance with large datasets by loading children on demand
21- **Customize display** - Use templates to format items, headers, footers, selected values, or error states
22- **Implement filtering** - Enable search functionality with configurable filter types (StartsWith, EndsWith, Contains)
23- **Ensure accessibility** - Provide WAI-ARIA compliance, keyboard navigation, and screen reader support
24- **Support multiple languages** - Localize UI with customizable keys and RTL support
25- **Bind remote data** - Integrate with OData, OData V4, Web APIs, or other remote data services
26- **Handle complex selection logic** - Use events, auto-check hierarchy, or selective node disabling
27
28## Component Overview
29
30The Dropdown Tree features:
31
32- **Hierarchical display**: Local (hierarchical/self-referential) and remote data sources with flexible binding
33- **Multi-selection modes**: Checkboxes with auto-check, multi-select with Ctrl/Shift keys, single select (default)
34- **Flexible templates**: Item, value, header, footer, noRecords, and actionFailure templates for custom rendering
35- **Performance optimization**: Lazy loading (load-on-demand) for efficient large dataset handling
36- **Search & filtering**: Built-in filter bar with configurable filter types and case sensitivity options
37- **Comprehensive events**: change, select, dataBound, filtering, beforeOpen, focus, keyPress, and popup events
38- **Accessibility**: Full WAI-ARIA (roles, attributes), keyboard navigation, screen reader support, WCAG 2.2 compliance
39- **Localization**: Multi-language support with 4 customizable keys and locale override
40- **RTL support**: Right-to-left layout rendering
41- **Tree settings**: Advanced configuration (expandOn, autoCheck, loadOnDemand, checkDisabledChildren)
42- **Field mapping**: Flexible data structure support (value, text, child, parentValue, expanded, hasChildren, selectable, iconCss, imageUrl, htmlAttributes)
43- **Display modes**: Default, Delimiter, and Custom modes for selected items
44
45## Documentation and Navigation Guide
46
47### Getting Started
48📄 **Read:** [references/getting-started.md](references/getting-started.md)
49- Installation and package dependencies (npm install command)
50- React/TypeScript project setup (Vite and Create React App)
51- Basic component implementation and initialization
52- CSS imports and theme configuration
53- First render and minimal working example
54
55### Data Binding
56📄 **Read:** [references/data-binding.md](references/data-binding.md)
57- Local data binding (hierarchical and self-referential structures)
58- Remote data with DataManager and various adaptors (OData, OData V4, WebAPI, URL)
59- Field mapping for value, text, child, parentValue, expanded, hasChildren
60- Load on demand (lazy loading) for large datasets
61- Preventing node selection with selectable field
62- Query configuration for remote data services
63
64### Checkbox & Multi-Selection
65📄 **Read:** [references/checkbox-selection.md](references/checkbox-selection.md)
66- Enabling checkbox support with `showCheckBox` property
67- Multi-selection workflow and accessing selected values
68- Auto-check hierarchical behavior (parent-child synchronization)
69- Select All feature with customizable `selectAllText` and `unSelectAllText`
70- Intermediate checkbox states for partial selection
71- CheckDisabledChildren behavior for disabled nodes
72
73### Templates
74📄 **Read:** [references/templates.md](references/templates.md)
75- Item template for custom list item rendering
76- Value template for selected display customization
77- Header template for static content above items
78- Footer template for static content below items
79- NoRecords template for empty state handling
80- ActionFailure template for error state handling
81- CustomTemplate for multi-select display customization
82- Template expression syntax and data access patterns
83
84### Multi-Selection & Filtering
85📄 **Read:** [references/multi-selection-filtering.md](references/multi-selection-filtering.md)
86- `allowMultiSelection` property and Ctrl/Shift keyboard interaction
87- Display modes: Default, Delimiter, Custom
88- `delimiterChar` and `mode` configuration
89- `allowFiltering` and filter bar implementation
90- Filter types: StartsWith, EndsWith, Contains
91- `filterBarPlaceholder` customization
92- `ignoreCase` and `ignoreAccent` options
93
94### Tree Settings & Configuration
95📄 **Read:** [references/tree-settings.md](references/tree-settings.md)
96- `loadOnDemand` for lazy loading implementation
97- `autoCheck` for hierarchical checkbox synchronization
98- `expandOn` behavior (Auto, Click, DblClick, None)
99- `checkDisabledChildren` for disabled node handling
100- Tree expansion and collapse control
101
102### Field Mapping & Custom Data Structures
103📄 **Read:** [references/field-mapping.md](references/field-mapping.md)
104- Core fields: value, text, dataSource, child, parentValue
105- Node state fields: expanded, hasChildren, selected, selectable
106- Display enhancement fields: iconCss, imageUrl, htmlAttributes
107- Query and tableName for remote data
108- Nested field mapping for hierarchical data
109
110### Advanced Features & API Reference
111📄 **Read:** [references/advanced-features.md](references/advanced-features.md)
112- Properties (60+ properties with descriptions and examples)
113- Methods (getSelectedNodes, getCheckedNodes, setCheckedNodes, etc.)
114- Events (change, select, dataBound, filtering, beforeOpen, focus, keyPress, popup)
115- Event arguments (EventArgs structures with property descriptions)
116- Styling and CSS customization
117- Performance optimization techniques
118
119### Accessibility & Localization
120📄 **Read:** [references/accessibility-localization.md](references/accessibility-localization.md)
121- WCAG 2.2 and Section 508 compliance standards
122- WAI-ARIA attributes and roles (listbox, treeitem, checkbox, group, etc.)
123- Keyboard navigation shortcuts (Alt+Down, Arrow keys, Enter, Space, etc.)
124- Screen reader and assistive technology support
125- Localization keys (noRecordsTemplate, actionFailureTemplate, overflowCountTemplate, totalCountTemplate)
126- Culture customization with locale property
127- RTL (Right-to-Left) language support with enableRtl
128
129## Quick Start
130
131### Basic Dropdown Tree with Hierarchical Data
132
133```jsx
134import { DropDownTreeComponent } from '@syncfusion/ej2-react-dropdowns';
135import '@syncfusion/ej2-dropdowns/styles/material.css';
136
137function App() {
138 const data = [
139 { id: '1', name: 'Electronics', expanded: true },
140 { id: '2', name: 'Laptops', parentId: '1' },
141 { id: '3', name: 'Phones', parentId: '1' },
142 { id: '4', name: 'Appliances' },
143 ];
144
145 return (
146 <DropDownTreeComponent
147 id="dropdowntree"
148 fields={{ dataSource: data, value: 'id', text: 'name', parentValue: 'parentId', hasChildren: 'hasChild' }}
149 placeholder="Select an item"
150 />
151 );
152}
153
154export default App;
155```
156
157### With Checkboxes and Auto-Check
158
159```jsx
160<DropDownTreeComponent
161 id="dropdowntree"
162 fields={{ dataSource: data, value: 'id', text: 'name', parentValue: 'parentId', hasChildren: 'hasChild' }}
163 showCheckBox={true}
164 showSelectAll={true}
165 treeSettings={{ autoCheck: true }}
166 placeholder="Select items"
167/>
168```
169
170### With Filtering
171
172```jsx
173<DropDownTreeComponent
174 id="dropdowntree"
175 fields={{ dataSource: data, value: 'id', text: 'name', parentValue: 'parentId' }}
176 allowFiltering={true}
177 filterType="Contains"
178 filterBarPlaceholder="Search items..."
179 placeholder="Select an item"
180/>
181```
182
183### With Custom Templates
184
185```jsx
186<DropDownTreeComponent
187 id="dropdowntree"
188 fields={{ dataSource: data, value: 'id', text: 'name', parentValue: 'parentId' }}
189 itemTemplate={(props) => (
190 <div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
191 <span>{props.name}</span>
192 <small style={{ color: '#999' }}>({props.category})</small>
193 </div>
194 )}
195 valueTemplate={(props) => <span>{props.name}</span>}
196 placeholder="Select item"
197/>
198```
199
200## Common Patterns
201
202### Pattern 1: Self-Referential Data Binding
203
204For flat data structures with parent references:
205
206```jsx
207const data = [
208 { id: 1, name: 'Discover Music', hasChild: true, expanded: true },
209 { id: 2, pid: 1, name: 'Hot Singles' },
210 { id: 3, pid: 1, name: 'Rising Artists' },
211 { id: 7, name: 'Sales and Events', hasChild: true },
212 { id: 8, pid: 7, name: '100 Albums' },
213];
214
215<DropDownTreeComponent
216 id="dropdowntree"
217 fields={{
218 dataSource: data,
219 value: 'id',
220 text: 'name',
221 parentValue: 'pid',
222 hasChildren: 'hasChild',
223 }}
224/>
225```
226
227### Pattern 2: Event Handling for Selection Changes
228
229```jsx
230const handleChange = (args) => {
231 console.log('Old values:', args.oldValue); // string[]
232 console.log('New values:', args.value); // string[]
233 console.log('User interaction:', args.isInteracted); // boolean
234};
235
236const handleSelect = (args) => {
237 console.log('Action:', args.action); // 'select' or 'unselect'
238 console.log('Item data:', args.itemData); // object
239};
240
241<DropDownTreeComponent
242 id="dropdowntree"
243 fields={fields}
244 onChange={handleChange}
245 onSelect={handleSelect}
246/>
247```
248
249### Pattern 3: Multi-Select with Auto-Check
250
251```jsx
252<DropDownTreeComponent
253 id="dropdowntree"
254 fields={fields}
255 showCheckBox={true}
256 treeSettings={{ autoCheck: true }}
257 mode="Default"
258 delimiterChar=", "
259 placeholder="Select multiple items"
260/>
261```
262
263### Pattern 4: Lazy Loading for Large Datasets
264
265```jsx
266const remoteData = new DataManager({
267 url: 'url',
268 adaptor: new UrlAdaptor(),
269});
270
271<DropDownTreeComponent
272 id="dropdowntree"
273 fields={{ dataSource: remoteData, value: 'id', text: 'name', hasChildren: 'hasChild' }}
274 treeSettings={{ loadOnDemand: true }}
275 placeholder="Loading..."
276/>
277```
278
279### Pattern 5: Custom Item Styling with IconCss
280
281```jsx
282const data = [
283 { id: 1, name: 'Documents', iconCss: 'e-folder', hasChild: true },
284 { id: 2, pid: 1, name: 'Resume.pdf', iconCss: 'e-pdf' },
285 { id: 3, pid: 1, name: 'Report.docx', iconCss: 'e-docx' },
286];
287
288<DropDownTreeComponent
289 id="dropdowntree"
290 fields={{
291 dataSource: data,
292 value: 'id',
293 text: 'name',
294 iconCss: 'iconCss',
295 parentValue: 'pid',
296 hasChildren: 'hasChild',
297 }}
298/>
299```
300
301### Pattern 6: RTL & Localization Support
302
303```jsx
304<DropDownTreeComponent
305 id="dropdowntree"
306 fields={fields}
307 enableRtl={true}
308 locale="ar"
309 placeholder="اختر عنصرا"
310/>
311```
312
313## Key Props Overview
314
315| Property | Type | Description |
316|----------|------|-------------|
317| **Core** |
318| `id` | string | Unique identifier for the component |
319| `fields` | FieldsModel | Data source and field mapping configuration |
320| `placeholder` | string | Input placeholder text |
321| `enabled` | boolean | Enable/disable component (default: true) |
322| **Selection** |
323| `showCheckBox` | boolean | Enable checkbox multi-selection (default: false) |
324| `showSelectAll` | boolean | Show Select All checkbox (default: false) |
325| `selectAllText` | string | "Select All" label text |
326| `unSelectAllText` | string | "Unselect All" label text |
327| `allowMultiSelection` | boolean | Enable multi-selection with Ctrl/Shift keys |
328| **Templates** |
329| `itemTemplate` | string \| Function | Custom item rendering |
330| `valueTemplate` | string \| Function | Custom selected value display |
331| `headerTemplate` | string \| Function | Custom header content |
332| `footerTemplate` | string \| Function | Custom footer content |
333| `noRecordsTemplate` | string \| Function | Empty state template |
334| `actionFailureTemplate` | string \| Function | Error state template |
335| **Filtering** |
336| `allowFiltering` | boolean | Enable search/filter bar (default: false) |
337| `filterType` | TreeFilterType | Filter type: StartsWith, EndsWith, Contains |
338| `filterBarPlaceholder` | string | Filter bar placeholder text |
339| `ignoreCase` | boolean | Case-insensitive filtering (default: true) |
340| `ignoreAccent` | boolean | Ignore diacritics in filtering |
341| **Tree Settings** |
342| `treeSettings` | TreeSettingsModel | Tree behavior configuration (autoCheck, loadOnDemand, expandOn) |
343| **Display** |
344| `mode` | string | Display mode: Default, Delimiter, Custom |
345| `delimiterChar` | string | Delimiter for multi-select (default: ", ") |
346| `customTemplate` | string | Custom multi-select display template |
347| **Localization & RTL** |
348| `locale` | string | Culture code (default: "en") |
349| `enableRtl` | boolean | Enable Right-to-Left layout |
350| `enablePersistence` | boolean | Persist state between page reloads |
351| **Styling** |
352| `cssClass` | string | CSS class for root and popup |
353| `width` | string \| number | Component width |
354| `popupHeight` | string \| number | Popup height |
355| `htmlAttributes` | object | HTML attributes for the component |
356
357## Decision Guide
358
359**Choosing Data Binding:**
360- **Local hierarchical** - Nested JSON objects with `child` property for small-to-medium datasets
361- **Local self-referential** - Flat arrays with `parentValue` field for structured data
362- **Remote with DataManager** - OData/Web API for large datasets, dynamic loading, real-time data
363
364**Choosing Selection Mode:**
365- **Single select** - Default (no checkboxes, no multi-select), read-only visual selection
366- **Checkboxes** - `showCheckBox={true}` for explicit multi-selection
367- **Multi-select** - `allowMultiSelection={true}` for Ctrl/Shift keyboard selection
368- **Auto-check** - Combine checkboxes with `treeSettings={{ autoCheck: true }}` for hierarchy sync
369
370**Choosing Template:**
371- **itemTemplate** - Custom formatting per tree item (name + description, icons, badges)
372- **valueTemplate** - Custom display in input field (combined text, formatted values)
373- **headerTemplate** - Static controls above list (instructions, search help, custom controls)
374- **footerTemplate** - Static content below list (count summary, action buttons)
375- **noRecordsTemplate** - Empty state when no data or search yields no results
376- **actionFailureTemplate** - Error message when data fetch fails
377
378**When to Use Lazy Loading:**
379- Large datasets (1000+ items)
380- Performance-critical applications
381- Data fetched from remote API with pagination
382- Hierarchies with many levels
383
384**When to Use Filtering:**
385- Large datasets requiring search
386- User-friendly discovery of items
387- Reducing cognitive load for selection
388
389## Next Steps
390
391- **Get started** → Read [getting-started.md](references/getting-started.md)
392- **Bind data** → Read [data-binding.md](references/data-binding.md)
393- **Add checkboxes** → Read [checkbox-selection.md](references/checkbox-selection.md)
394- **Enable filtering** → Read [multi-selection-filtering.md](references/multi-selection-filtering.md)
395- **Configure trees** → Read [tree-settings.md](references/tree-settings.md)
396- **Map fields** → Read [field-mapping.md](references/field-mapping.md)
397- **Customize** → Read [templates.md](references/templates.md)
398- **Access APIs** → Read [advanced-features.md](references/advanced-features.md)
399- **Enhance UX** → Read [accessibility-localization.md](references/accessibility-localization.md)