Skip to main content

Layout Manager

Overview

SolidViewLayoutManager should be the default utility for runtime layout mutation in extension listeners.

Use it instead of deep-mutating raw layout objects.

Where It Is Used

  • Form listeners (onFormLoad, onFieldChange, onFieldBlur)
  • List listeners (onBeforeListDataLoad, onListLoad) when layout updates are needed

Form Example

import { SolidViewLayoutManager } from "@solidxai/core-ui";

export function handleBookFormEvents(event: any) {
if (event.type !== "onFormLoad") return {};

const manager = new SolidViewLayoutManager(event.viewMetadata.layout);
manager.updateNodeAttributes("advanced-section", { visible: false });

return {
layoutChanged: true,
newLayout: manager.getLayout(),
};
}

List Example

import { SolidViewLayoutManager } from "@solidxai/core-ui";

export function handleBookListEvents(event: any) {
if (event.type !== "onListLoad") return {};

const manager = new SolidViewLayoutManager(event.listViewLayout);
manager.updateNodeAttributes("internal-score-column", { visible: false });

return {
layoutChanged: true,
newLayout: manager.getLayout(),
};
}

Required Return Flags

Without flags, changes are ignored by the runtime.

  • Layout mutation: return layoutChanged: true with newLayout
  • Data mutation: return dataChanged: true with full newFormData or newListData
  • Filter override (list prefetch): return filterApplied: true with newFilter

Safety Guidance

  • Ensure node IDs exist before update operations.
  • Keep mutations deterministic.
  • For frequent events (for example onFieldChange), avoid heavy synchronous logic.

See Also