Hi,
I was trying to build use case where we have to add dynamic elements in a accordion as accordionitems or new Accordion itself. Please check the snippet: http://webix.com/snippet/2c5f808f . For this example, it possible to show the ‘Dynamic Accordion’ below the ‘Add view’ button ( in the ‘Row 1’ body) or at least the contents of the ‘Dynamic Accordion’ in the body of ‘Row 1’ ? Many thanks for your help in evaluation
Check the updated snippet
http://webix.com/snippet/5a3d1202
Your original code is mostly valid. There are two corrections
- index calculations, you are adding to the “accordion” view, so you need to get the index of its child (col1), not some grand-child (“text1”)
- it has sense to use webix.copy if you plan reuse the same part of ui config multiple times
Thanks @maksim. I had another question: is it possible to to display the contents of the accordion below the ‘Add View’ button ( not as a seperate accordion) ? Should i descibe the view as AccordionItem? please guide…
Yep, http://webix.com/snippet/408e1cee
You need to clearly specify view:"accordionitem"
in such case.
@maksim - thanks but it appears as a seperate accordion. It is not unfolded within the body of ‘Row 1’ below the button ‘Add View’? How to achieve that?
Thanks in advance
The above snippet adds a new panel in the top level accordion. It doesn’t create a new accordion.
Do you add a new panel after “Add View” button so it will be inside of “Row 1” ?
Yes… i was aiming for that.
http://webix.com/snippet/da814c94
The same code, accordionitem removed, correct parent specified
And one more, if you still want it to be the accordionitem
http://webix.com/snippet/3e2527d7