Core Docs

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:

FieldVai trò
RefNameTên entity nguồn (entity phải có field ParentId self-reference).
CanAddTrue → hiển thị nút thêm node con.

Events

Kế thừa từ ListViewChange, 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.

Core Docs · Astro · Core.API/wwwRoot/docs