# j-FormTab

> j-FormTab: The component moves the content of this component under <body> tag (because of positioning); The component expects array

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

- The component moves the content of this component under `<body>` tag (because of positioning)
- The component expects array


__Configuration__:

- `width {Number}` width of form
- `widthlg {Number}` width of form for `lg` devices (default: `config.width`)
- `widthmd {Number}` width of form for `md` devices (default: `config.width`)
- `widthsm {Number}` width of form for `sm` devices (default: `config.width`)
- `widthxs {Number}` width of form for `xs` devices (default: `config.width`)
- `height {Number}` height of form
- `heightlg {Number}` height of form for `lg` devices (default: `config.height`)
- `heightmd {Number}` height of form for `md` devices (default: `config.height`)
- `heightsm {Number}` height of form for `sm` devices (default: `config.height`)
- `heightxs {Number}` height of form for `xs` devices (default: `config.height`)
- `margin {Number}` a default margin between forms (default: `10`)
- `marginlg {Number}` a default margin for `lg` devices (default: `config.margin`)
- `marginmd {Number}` a default margin for `md` devices (default: `config.margin`)
- `marginsm {Number}` a default margin for `sm` devices (default: `config.margin`)
- `marginxs {Number}` a default margin for `xs` devices (default: `config.margin`)
- `marginfullscreen {Number}` a default margin for fullscreen mode (default: `20`)
- `marginfullscreenlg {Number}` a default fullscreen margin for `lg` devices (default: `config.marginfullscreen`)
- `marginfullscreenmd {Number}` a default fullscreen margin for `md` devices (default: `config.marginfullscreen`)
- `marginfullscreensm {Number}` a default fullscreen margin for `sm` devices (default: `config.marginfullscreen`)
- `marginfullscreenxs {Number}` a default fullscreen margin for `xs` devices (default: `config.marginfullscreen`)
- `submit {String}` link to a global function `function(meta, data, hide)` and it's executed if the submit button is pressed
- `cancel {String}` link to a global function and it's executed if the `cancel` button is pressed
- `enter {Boolean}` captures `enter` key automatically and virtually clicks on the submit button (default: `false`)
- `onclose {String}` a link to function `function(item, close)` (optional)
- `onopen {String}` a link to function `function(item, el)` (optional)
- `autofocus {Boolean}` enables auto-focus for the first input (default: `false`)
- __NEW__ `right {Number}` right margin (defualt: `0`)
- __NEW__ `bottom {Number}` bottom margin (defualt: `0`)
- __NEW__ `useminheight {Boolean}` use `min-height` instead of `height` CSS attribute (default: `false`)

__Good to know__:

- each element with `cancel` class will be used as a cancel button

__Data-Source__:

```javascript
[
	{
		// Required
		id: 'YOUR_ID_OF_THE_FORM',
		name: 'YOUR_NAME_OF_THE_FORM',

		// Optional
		minimized: true,
		data: { blabla: '"data" will be cloned into the form scope' }
		// NEW: scope: false (disables scope)
		// NEW: scope: mycustomscopepath
	}
]
```

Use it with `<ui-component name="formtab">`. 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="formtab" path="common.formtab">
	<script type="text/html">
		<div class="padding">
			YOUR CONTENT HERE.
		</div>
	</script>
</ui-component>

<script>
	var common = {};
	common.formtab = [];
	common.formtab.push({ id: '1', name: 'New message' });
	common.formtab.push({ id: '2', minimized: true, name: 'Message: John Deal' });
	common.formtab.push({ id: '3', minimized: true, name: 'Message: Denis Granec' });
</script>
```
