Core Docs

Checkbox

Boolean toggle — bind `bool` hoặc `bool?` của entity.

Source: Core/Components/Checkbox.cs · ComType: Checkbox

Cấu hình

ComType:    Checkbox
FieldName:  Active
Label:      Đang hoạt động

Field DB dùng

FieldVai trò
FieldNameProperty của entity (bool hoặc bool?).
EditableFalse → render disabled (không cho user click).
EventsJSON map event → method C# (Change).

(Checkbox không cần ShowLabel riêng — label nằm cùng checkbox theo style.)

Events kích hoạt

EventMethod signature
change(entity, newValue, oldValue, parent)

newValue / oldValuebool.

public void OnActiveChanged(object entity, object newVal, object oldVal, object parent)
{
    var c = (Customer)entity;
    if ((bool)newVal == false)
    {
        Toast.Small("Khách hàng " + c.Name + " bị ngừng hoạt động");
    }
}

Tip

  • Bind sang bool? (nullable) → check 3 trạng thái: true / false / null. Hiếm dùng.
  • Editable = false → render disabled.

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