DHTMLX Touch documentation

View

View is a base class for all ui-related components, 'ground' for their placing.
A single view presents just a frame on a screen and doesn't contain anything inside. It's like a box where you store various things.


An example of usage.

Initialization

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.view({...})// direct declaration
//or
dhx.ui ({...})//common declaration

Parameters

Whatever variant you choose it will include some of the following parameters (all of them are optional):

  • container - an id of the html container where view will be initialized.
    So, to set view sizes you can either place a container on the page or use height and width parameters.
  • css - lets to define a css class for view container
  • id - the name of the view.
    The parameter is used for component calling. Specify it if you need to use the view further.
  • gravity - defines the space width proportions.
    When you deal with several elements, space for them is given according to this parameter.
    Elements proportions, not their widths, are constant. Please note, if you set gravity
    and width parameters at the same time, gravity parameter will be ignored.
  • height - the height of the view.
    Default value -1 means that the parameter will be ignored.
  • width - the width of the view.
    Default value -1 means that the parameter will be ignored.

Please note, view is a base class, i.e. all the derived components inherit its features.

dhx.ui({ 
	id: "someview",
	height:250,
	width: 700
});

Related how-tos

The full list of how-tos.

To use ui functionality, touchui.css and touchui.js files must be included.