The "accordionitem" view inherits from view and is an integral part of the UI-related Accordion component. You need at least two Accordion items to make a workable Accordion.
Any Accordion item must have two properties: header for heading and body for the main text or some UI component.
webix.ui({
rows:[ // or cols
{
view:"accordionitem",
header:"Pane 1",
headerHeight:20,
headerAlt:"Pane 2 Closed",
body:{ view:"form", ...} //ui component
},
{
view:"accordionitem",
header:"Pane 2",
headerAlt:"Pane 2 Closed",
body:"This is Pane 2 body", //just text
collapsed: true
}
]
})
The view:"accordionitem"
line can be omitted. If you create a view with a header and a body, Webix knows that you want to create an accordionitem.
{
header:"Pane 1",
body:{ view:"form", ... } //ui component
}
You do not need to state the view type as view:"accordionitem"
to initialize an accordion panel:
webix.ui({
view:"accordion",
rows:[
{
view:"accordionitem", // optional
header:"Pane",
body:"Pane 1"
},
{
header:"Pane",
body:"Pane 1"
},
{ ... }
]
});
Accordion items can be collapsed and expanded with the help of dedicated methods:
$$('item1').collapse();
$$('item1').expand();
//don't forget to specify IDs to accordionitems!
If the items of your accordion are arranged in cols, their headers are collapsed to vertical panels as you close an accordionitem.