Clone on Gitea
Introduction
Explained by ducks
FAQ
Getting Started
Components
Component Basics
Auto Initialization From DOM
Templates
Children and Parents
Roles
Strictness
Fields
What is a Field
Binding Fields to DOM
Reading and Writing Fields
Value Casting
Flags
Events
Overview
Event Handlers
DOM Events
Custom Events
Propagation and Flow
Advanced Event Control
Beyond Components
States
Overview
StateEngine
DisplayStateEngine
Field Matchers
Ordering and priority
Debugging
Advanced usage
Ajax
ComponentUI
VirtualForm
Unit Testing
Helpers
Overview
Cookies
Arrays

Propagation and Flow

Events in Qite move through explicit parent-child relationships. There is no global event bus and no hidden broadcasting. Understanding this flow is important when building larger component trees.

Basic propagation

When a component publishes an event:

  1. It is first delivered to itself (if it listens using "self").
  2. Then delivered to its parent.
  3. Then parent may publish another event upward if needed.

Events do not skip levels and they do not automatically travel across the entire tree.

Example: device control panel

Imagine a control panel managing several IoT devices.

class DevicePanelComponent extends BaseComponent {
    constructor(tree_node) {
        super(tree_node);

        this.events.add([
            ["toggle", ">device_switch", (data) => {
                this.handleToggle(data.device_id, data.enabled);
            }]
        ]);
    }
}

Each device_switch child component publishes a "toggle" event when its internal state changes. The panel does not listen to DOM events inside device_switch. It listens only to the domain-level "toggle" signal emitted by the child.

Self-delivery

If a component publishes an event and also listens using "self", the handler will run immediately before the event travels upward.

this.events.add([
    ["refresh", "self", () => this.loadTelemetry()]
]);

this.events.publish("refresh");

This pattern is sometimes useful for internal orchestration, but should be used intentionally.

No implicit broadcasting

Publishing an event does not automatically notify siblings or distant components — only the parent receives it by default. If a parent wants to inform its own parent, it must publish another event. Event flow is always explicit.