Subview in a subview

Hi. I’m working on a datatable that needs to drill down from a list of locations, to all of the departments of that chosen location, then all of the employees for that department in that location.
I have the main datatable displaying all of the locations properly and it is able to call a subview of a datatable to show all of the departments. At this point I need this subview to be able to call the subview of the employees, but nothing shows up. As I test I was able to display something in the subrow, but not the subview. I verified that the employee subview does work, but only when called from the main datatable. It doesn’t look like a subview can call a subview. Is there a work around?

The next level of difficulty I have is to pass data to the subviews, so I will know which location and department are selected on each level. I’m using a javascript array for my data within an angular application, so certain things do not work for me, like .addEvent(). I can get the data to display if I hard code the array index, but I need it to be determined dynamically.

Any help with either issue will be greatly appreciated.

I found the answer on how to pass the data to a subview. In onSubViewCreate:function(view, item) I use view.parse() to pass a javascript array for the subview to use.
Now I just need to figure out the subview of a subview problem.

Hi @kprice ,

By default, multiple subviews work OK, so could you please share a sample of problematic code?

https://snippet.webix.com/ywui2c87

Thank you for the example; it helped point me in the right direction.
I’m using webix within an angular project, so it’s tough for me to use the code in an example. For some reason autoheight in the subview prevented the subview from working, but if when I set the height to a specific value the 2nd subview displayed.

As far as I can see, there is no any obvious reason for such behaviour. Could you please also clarify which version of Webix and Angular (JS or 2+) do you use?

It looks like we are using angular 5 and webix-pro 5

Here is the just the webix code: https://snippet.webix.com/2vm43lc4

I made some example data, but it shows how the subviews have some odd sizing.

@kprice minHeight and maxHeight define the sizing limits for relative sizing (defined in layout as gravity) or for manual resize with resizer component.
Without these conditions, the view will take the minHeight as a constant height. For correct autosizing, I would suggest you use autoheight for subviews and any sizing properties for the top grid.

But please note also that autoheight calculates the height of the component according to its content, so the vertical scroll on the view with this property will be disabled.

Please check: https://snippet.webix.com/zcw355xj

As a side note, relative property is supported only in popups/windows. For more details on sizing options, please check the following docs.

Thank you for your help. It turns out I was using autoHeight, matching the naming convention for the other properties, and not autoheight…with that everything is working fine.

Is there a way to have a scroll bar on a subview? I’m not sure if it will work in the example, but my project can have a great number of people in each department.