Build your web apps using Smart UI Library
Smart.Editor - iFrame Mode
iFrame Editor
Smart.Editor's content section can be easily stylied or modifed via CSS or Javascript. However the Editor has an additional iframe mode which places the Editor's content inside an iframe which provides an isolated DOM that does not allow styles and scripts to leak in.
The iframe mode is not enabled by default. A property of type object called iframeSettings that configures the iframe mode with the following settings:
- enabled - determines whether iframe mode is enabled or not.
- attributes - an object that defines attributes for the iframe, for example:
attributes: { height: 500 }All native iframe attributes are supported.
-
resources - an object that determines what styles and scripts should be imported into the
iframe's DOM. For example:
resources: { 'style': { href: 'styles.css' }, 'script': { src: 'index.js', type: 'module' } }The href and src attributes should point to the file location and name.
The type attribute determines whether the JS file should be loaded as a module or not.
For AI tooling
Developer Quick Reference
Topic: editor-iframe-mode Component: Editor Framework: JavaScript
Main methods: (none detected)
Common config keys: (none detected)
Implementation Notes
Compatibility: Modern browsers / Web Components API access pattern: const component = document.querySelector(...) + component.method()
Lifecycle guidance: Initialize configuration first, then invoke imperative API when element is available in DOM.
Common pitfalls:
- Calling methods before element initialization.
- Reassigning large configuration partially without understanding merge behavior.
- Missing required module script import for component type.
Validation checklist:
- Ensure module scripts and CSS are loaded once.
- Keep data schema aligned with columns/series definitions.
- Verify method calls target initialized component instance.