Mulitple TreeTables on a single page

I need to be able to have multiple treetables on a single page at the same time loaded with different data

I can easily do this my typing in a bunch of javascript and duplicating tons of intialization and event code

However, I need to be able to do this dynamically depending on how many items div (for the treetable) objects I pass to a function

Even if I can see a sample of how to have multiple grids in an array or some other Webix object would be fantastic

I do have it working (not well) with an array but it does not work properly

Any help would be great

As webix UI configuration is a normal json, you can easily move it to the function and generate as much times as necessary
http://webix.com/snippet/e78ec9bc

Thanks, this a a great help!