addView

adds a new view to a grid layout

string|number addView(object view, [number index] );

Parameters

viewobjectthe configuration of the new view
indexnumberthe index a new view will be added at

Returns

string|numberthe id of the new view

Example

webix.ui({
    view:"gridlayout", 
    id:"grid",
    gridColumns:4, gridRows:3,
    cells:[
        { id:"a", template:"Single", x:0, y:0, dx:1, dy:1 },
        { id:"b", template:"Wide 1", x:1, y:0, dx:2, dy:1 }
        // more cells
    ]
});
 
$$("grid").addView({ template:"Column", x:1, y:1, dx:1, dy:1 });

Related samples

Details

A GridLayout cell has the following attributes:

  • x - (number) the x-index of a grid cell starting point
  • y - (number) the y-index of a grid cell starting point
  • dx - (number) the width of a view defined as a number of grid cells
  • dy - (number) the height of a view defined as a number of grid cells
See also
Back to top