MultipleButtonPdf
Dropdown chứa nhiều template PDF — user pick template, button thực thi.
Source:
Core/Components/MultipleButtonPdf.cs· ComType:MultipleButtonPdf
Cấu hình
ComType: MultipleButtonPdf
Label: Xuất PDF
DataSourceFilter: ?$filter=Active eq true # filter list template
DefaultVal: invoice-default.pdf
Field DB dùng
| Field | Vai trò |
|---|---|
Label | Text trên button. |
DataSourceFilter | OData filter đủ ?$filter=... lọc list templates. |
DefaultVal | Tên template được chọn mặc định (vd "invoice-default.pdf"). |
Events | JSON map {"click": "...", "AfterDownload": "..."} để hook handler. |
FormatEntity | Format entity truyền vào render template. |
Style | Inline CSS style cho dropdown button. |
TopEmpty | True → option “Không chọn” ở đầu dropdown. |
UpperCase | True → text uppercase trong PDF. |
PlainText | True → render plain. |
Events kích hoạt
| Event | Method signature |
|---|---|
click | (entity, ...) |
AfterDownload | (entity, result) |
result là response từ backend (status, file URL).
public void OnPdfDownloaded(object entity, object result)
{
Toast.Success("Đã tải PDF");
}
Tip
- Dùng khi 1 entity có nhiều template (vd hoá đơn có template Tiếng Việt + Tiếng Anh + Có VAT).
DefaultVallà template được chọn mặc định.DataSourceFilterphải đủ?$filter=....