Core Docs

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

FieldVai trò
LabelText trên button.
DataSourceFilterOData filter đủ ?$filter=... lọc list templates.
DefaultValTên template được chọn mặc định (vd "invoice-default.pdf").
EventsJSON map {"click": "...", "AfterDownload": "..."} để hook handler.
FormatEntityFormat entity truyền vào render template.
StyleInline CSS style cho dropdown button.
TopEmptyTrue → option “Không chọn” ở đầu dropdown.
UpperCaseTrue → text uppercase trong PDF.
PlainTextTrue → render plain.

Events kích hoạt

EventMethod 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).
  • DefaultVal là template được chọn mặc định.
  • DataSourceFilter phải đủ ?$filter=....

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