It seems that you can’t use any flag other than 0 for the entries in a popup menu; otherwise, some of them will disappear. Is that by design?
function OnClick(clickData) {
DOpus.ClearOutput();
var dlgMenu = DOpus.Dlg();
var choices = ['title 1', 'entry 1.1', 'entry 1.2', 'title 2', 'entry 2.1'];
dlgMenu.choices = choices;
dlgMenu.menu = [9, 0, 0, 9, 0];
dlgMenu.Show();
if (dlgMenu.result) {
DOpus.Output('You selected ' + choices[dlgMenu.result - 1]);
}
}