Accordion Layout

layout: { type: 'accordion' }

Demo

SAMPLE
CODE

The Accordion layout

The Accordion Layout displays child Views in an Accordion where you show child views by clicking on the titles.

To render child views in an accordion, set layout.type to "accordion" for the parent view.

var v = new ludo.View({
    layout: { 
        type:'accordion'
        ...

     },
     children:[ {...}, {...} ]
    ...
    ...
}

Set visible accordion view

By default, the first child view is shown. You can override this by using the layout.selected property on a child view:

layout: {
    type:'accordion'
},
children:[
    { title: "Title of 1st accordion", html : "Content 1" },
    { title: "Selected", html : "Content 2", layout: { selected: true },
    { type:"calendar.TimePicker", title: "Title of 2nd accordion"  }
]

Initially hidden child views

Child views where the hidden property is set to false

{ title:"Accordion View", hidden:true ... }

will not be displayed in the accordion.

If you want to show hidden child views during runtime, call

ludo.get('<id of child>').show();

Example

SAMPLE
CODE
Generated 2016-12-02 19:27:13