Template View

Template view is a ui-related class inherited from view. The addition of this class is possibility to add some content.


Full code of the example in the picture

Iniialization

To init the component you need to perform a simple procedure - call initialization code.

Initialization code or an object constructor gives you a choice: you can create an object directly or by using common declaration.

dhx.ui.template({...})// direct declaration
//or
dhx.ui ({...})//common declaration

Parameters

Whatever variant you choose it will include some of the following parameters:

  • template - (string or template) template of the data for the cell.
    Lets to add simple data (you can set them by single string)
  • content - the id or node, whose content will be moved to the view.
    Lets to add really complex content: pictures, data arrays, whole components etc
  • src - (url) the http path to the content file. Allows to load template's content by AJAX
  • scroll - (boolean) enables/disables scrolling within the component. The default value is false - scrolling is disabled

Please note, template view is a derived class, i.e. it inherits all the features of the base classes (template view → view).

dhx.ui({ 
        rows:[ 
		{ 	view:"template", 
                        src:"data.php"
		},
        ...
        ]
});

Related how-tos