VerticalMenuControl.setNumberOfLevels

Sets the number of menu levels that will expand vertically. After this, subsequent menu levels will be shown as dynamic dropdowns

Further documentation.

Parameters

int  numberOfLevels,