DetachedScope
import {DetachedScope} from 'cx/widgets';DetachedScope is a component used exclusively to improve performance by detaching
certain areas from the rest of the page. Detached contents render in their own render loop and use
a data declaration which explains which changes can go in or out. This is commonly used to ensure optimal performance
with rich popups, grids, charts and other interactive structures that might be negatively affected by
other "heavy" elements visible on the page.
<DetachedScope bind="$page.scope1">
<div style="width: 150px; height: 150px; background: #d4d4d4; padding: 20px">
Heavy duty contents 1
</div>
</DetachedScope>
<DetachedScope bind="$page.scope2">
<div style="width: 150px; height: 150px; background: #d4d4d4; padding: 20px">
Heavy duty contents 2
</div>
</DetachedScope>| Property | Description | Type |
|---|---|---|
bind | A single binding path or a list of paths to be monitored for changes.
Use | string|array |
data | Data object selector. The children will update only if | object |
exclusive | A single binding path or a list of paths to be monitored for changes.
Use | string|array |
exclusiveData | Exclusive data selector. If only exclusive data change, the scope will be re-rendered without recalculating other elements on the page. Use in case if the scope uses both exclusive and shared data. | object |
name | Name of the scope used for debugging/reporting purposes. | string |
items | List of child elements. | array |
layout | Define an inner layout. | string/object |
outerLayout | Defines the outer layout which wraps the widget. | widget |
plainText | Set to | boolean |
preserveWhitespace | Keep whitespace in text based children. Default is | boolean |
putInto | Used with outer layouts. Specifies the name of the content placeholder which should render the widget. | string |
trimWhitespace | Remove all whitespace in text based children. Default is | boolean |
vdomKey | Key that will be used as the key when rendering the React component. | string |
visible | Visibility of the widget. Defaults to | boolean |