TreeView
List dạng cây — dùng cho menu, danh mục có ParentId, organization chart.
Source:
Core/Components/TreeView.cs· ComType:TreeView
Cấu hình
ComType: TreeView
RefName: Department
CanAdd: true
Field DB dùng
Kế thừa từ ListView / GridView. Field quan trọng:
| Field | Vai trò |
|---|---|
RefName | Tên entity nguồn (entity phải có field ParentId self-reference). |
CanAdd | True → hiển thị nút thêm node con. |
Events
Kế thừa từ ListView — Change, BeforeCreated, AfterCreated, BeforeDeleted, AfterDeleted, …
Behavior
- Entity tham chiếu phải có field
ParentId(FK self-reference) → cây. - Click row → mở/đóng node con.
CanAdd = true→ hiển thị nút thêm node con.
Tip
- Dùng cho danh mục cây sâu (department, product category, menu nested).
- Performance kém với cây > 5000 node — cân nhắc paging hoặc lazy-load.