# j-Releaser

> The component can release after some time own content (DOM) + memory. We recommend to use it for j-DataGrid, j-CodeMirror, j-CloudEditor, etc..

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: c3fb66cecefc89e7a96c687a1d1c3bb6298909250557e0e16dbf2886f8267508
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

The component can release after some time own content (DOM) + memory. We recommend to use it for `j-DataGrid`, `j-CodeMirror`, `j-CloudEditor`, etc..


__Configuration__:

- `if {String}` must contain a value for comparing with the model
- `delay {Number}` delay for removing of `invisible` class (default: `500`)
- `release {Number}` delay for releasing of the content in idle time (default: `10000`)
- `bindvisible {Boolean}` it evalutes the content if the component is visible (default: `false`)
- `released {String}` a link to the `function(component_element)` when the content is released
- `render {String}` a link to the `function(component_element)` when the content is going to render

__Example__:

```html
<ui-component name="releaser" path="common.form" config="if:userform">
	<script type="text/html">
		<ui-component name="datagrid" path=".......">
			<SCR type="text/html">
				YOUR COLUMNS
			</SCR>
		</ui-component>
	</script>
</
```

Use it with `<ui-component name="releaser">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<ui-component name="exec"></ui-component>

<ui-component name="releaser" path="common.form" config="if:userform;release:2000">
	<script type="text/html">
		<i class="ti ti-thumbs-up"></i> THE CONTENT IS RENDERED
	</script>
</ui-component>
<hr />
<button class="exec" data-exec="releaser_show">Show</button>
<button class="exec" data-exec="releaser_release">Release (2 sec)</button>

<script>
	function releaser_show() {
		SET('common.form', 'userform');
	}

	function releaser_release() {
		NUL('common.form');
	}
</script>
```
