I am creating a treeview styled object using KnockoutJS and need to be able to have x number of children folders and items. Has anyone done a recurring array on screen, I usually use foreach and I can put one child within another but I can't figure out how to change the template to make them recurring, is it even possible? To clarify I can get the items into knockout fine it's simply getting them displayed on screen.
Looked everywhere on the internet but can only find nested templates rather than recurring ones. Can anyone help?
Let me demonstrate how you can achieve this using a template. Let suppose you have the following viewmodel:
You can see here is multilevel branching. Now you can achieve this with recursion.
Fiddle Demo