Core Docs

ListView

Hiển thị list record với render tự do (card, kanban). Là base cho GridView.

Source: Core/Components/ListView.cs ComponentType trong DB: ListView. Khi GroupBy field set, Core tự pick GroupListView thay thế.

Cấu hình

ComType:           ListView
Reference:         Customer
DataSourceFilter:  ?$filter=Active eq true     # bắt buộc đủ "?$filter="
LocalRender:       true                         # render custom thay vì grid

Field DB dùng

FieldVai trò
ReferenceType entity nguồn (vd Customer).
RefNameTên entity dạng string.
ReferenceIdID reference (cho join phức tạp).
FieldName(Khi bind navigation collection của entity cha) — vd "Lines".
DataSourceFilterOData filter đủ ?$filter=... load list.
JoinTableTên bảng join SQL custom.
SqlSelectSQL custom thay cho OData (mạnh hơn).
SqlSearchSQL search tùy biến (cho VirtualGrid).
LocalDataInline data list — bypass API.
LocalHeaderCấu hình cột local (thay vì GridPolicy).
LocalRenderTrue → render custom (card, kanban) thay vì grid mặc định.
CanAddTrue → hiển thị button thêm row mới.
CanSearchTrue → hiển thị ô search.
CanCacheTrue → cache data trong session.
IsRealtimeTrue → push update qua WebSocket.
LiteGridTrue → render lightweight (ít feature, nhanh hơn).
IgnoreSyncTrue → không sync qua WS với grid khác.
IgnoreConfirmHardDeleteTrue → skip dialog confirm khi delete.
HideHistoryTrue → không track audit history.
LabelTiêu đề grid (header).
FocusTrue → auto focus grid khi render.
BodyItemHeightChiều cao mỗi row body (px).
HeaderHeightChiều cao header (px).
FooterHeightChiều cao footer (px).
ScrollHeightChiều cao container scroll.
RowSố dòng hiển thị (rare cho list).
DateTimeFieldField datetime dùng cho range search.
TopEmptyTrue → thêm row trống đầu list.
FilterLocalTrue → filter ở client thay vì server.
IdFieldTên field ID (default "Id").
GroupReferenceIdReference ID cho group.
MigrationScript migration nội bộ.
PrecisionSố chữ số thập phân (cho summary).
EventsJSON map event → method C#. Xem mục Events ở trên.
Id, ComponentGroup, ComponentTypeĐịnh danh / wiring nội bộ.

Events kích hoạt

EventMethod signature
change(rowData) — row patched thành công.
BeforeCreated(rowData)
AfterCreated(rowData)
BeforeCreatedList(rows) — bulk insert.
AfterCreatedList(rows)
BeforeDeleted(deletedItems)
AfterDeleted(deletedItems)
BeforePasted(originRows, copiedRows)
AfterPasted(originRows, copiedRows)
BeforeCopied(originRows, copiedRows)
AfterCopied(originRows, copiedRows)
Deactivated(entity)
UpdateHeader(columns) — sau khi reload column.
AfterWebsocket(updatedData, listViewItem)
SaveAs(this, editForm)

Khi nào dùng

✅ Render custom (card, kanban, free layout) — set LocalRender = true. ❌ Cần grid cột chuẩn → dùng GridView.

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