JQHTML(3) RSX Framework Manual JQHTML(3)
NAME
JQHTML - jQuery-based HTML component system for semantic UI development
SYNOPSIS
// Blade directive
<%= this.data.email %>
| <%= item.name %> |
<%= user.name %> - <%= user.email %>
<% } %> // With index <% for (let [idx, user] of this.data.users.entries()) { %><%= key %>: <%= this.data.settings[key] %>
<% } %> // Object.entries <% for (let [key, val] of Object.entries(this.data.config)) { %> <%= key %> = <%= val %> <% } %> JavaScript in Templates: Template JavaScript must be SYNCHRONOUS - no async/await: - Templates render entire HTML at once - All code in <% %> must complete immediately - Async operations belong in on_load() lifecycle method <% // ALLOWED: Synchronous calculations let total = 0; for (let item of this.data.items) { total += item.price; } %>Total: $<%= total.toFixed(2) %>
COMPONENT LIFECYCLE Five-stage deterministic lifecycle: render → on_render → on_create → on_load → on_ready 1. render (automatic, top-down) - Template executes, DOM created - First render: this.data = {} (empty object) - Parent completes before children - Not overridable 2. on_render() (top-down) - Fires immediately after render, BEFORE children ready - Hide uninitialized elements - Set initial visual state - Prevents flash of uninitialized content - Parent completes before children 3. on_create() (bottom-up) - Quick synchronous setup - Set instance properties - Children complete before parent 4. on_load() (bottom-up, siblings in parallel) - Load async data - ONLY modify this.data - NEVER DOM - NO child component access - Siblings at same depth execute in parallel - Children complete before parent 5. on_ready() (bottom-up) - All children guaranteed ready - Safe for DOM manipulation - Attach event handlers - Initialize plugins - Children complete before parent Depth-Ordered Execution: - Top-down: render, on_render (parent before children) - Bottom-up: on_create, on_load, on_ready (children before parent) - Parallel: Siblings at same depth during on_load() Critical rules: - Never modify DOM in on_load() - only update this.data - on_load() runs in parallel for siblings (DOM unpredictable) - Data changes during load trigger single re-render DOUBLE-RENDER PATTERN Components may render TWICE if on_load() modifies this.data: 1. First render: this.data = {} (empty) 2. on_load() populates this.data 3. Automatic re-render with populated data 4. on_ready() fires after second render (only once) Use for loading states:Loading products...
| <%= record.name %> |
No records found
Thank you!
'); } } CONTENT AND SLOTS JQHTML provides two patterns for passing content from parent to child: 1. content() Function (Primary Pattern - 95% of Use Cases) The content() function is the standard way to accept innerHTML:This content goes where content() is called
Name: <%= this.data.name %>
Email: <%= this.data.email %>
#body> <#footer> #footer>