addView

adds a new view to a carousel or moves an existing one

string|number addView(object view, [number index] );
viewobjectthe configuration of the view
indexnumberthe index a new view will be added at or an existing one will be moved to
string|numberthe id of the view

Example

webix.ui({
    id:"mycarousel",
    cols:[...]
});
// adds template as a third cell to some existing carousel
$$("mycarousel").addView({ template:"New one" }, 2);
 
// moves an existing child view to a different index 
$$("mycarousel").addView($$("child"), 3);

Related samples

Details

Passing an index as a second parameter will have full effect for layout rows and cols, accordion and carousel panels, toolbar and form controls. Some other widgets (e.g. multiview or containers with absolute positioning for child views) won't display changes in view order. Still, the real order (returned by getChildViews()) will always change accordingly.

See also
Back to top