HtmlView

Labels: :IA_Function:IA_HtmlView

View type function that generates HTML from a template and received data, and inserts in into the specified area and container.

Parameters

Key Description Default value Possible values
$area Area in which the generated HTML will be inserted
$container Container in which the generated HTML will be inserted
$css CSS style definitions inserted in the generated HTML
$data data that is injected in the template
$lists collections of data, will be grouped into objects to be rendered by moustache
$template Moustache html template

Incoming triggers

$lists parameter example

	$lists.nodes.id: [1,2,3,4],
	$lists.nodes.name: ['one', 'two', 'three', 'four']

In template:

	{{#lists.nodes}}
	 	<li>{{id}} - {{name}}</li>
	{{/lists.nodes}}

Outgoing triggers

Html elements with .trigger-click class will execute a click trigger:

	{
		type: 'click',
		data: {data-attributes of the clicked element}
	}

Html elements with .context-[menu-name] class will open a context menu defined by the context menu triggers connected to the HtmlView.

Forms in the HTML will execute a submit trigger when submited:

	{
		type: 'submit',
		form: 'form name-attribute value',
		data: {form data}
	}