Submenus in Tracklist Menu Items

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Submenus in Tracklist Menu Items

Re: Submenus in Tracklist Menu Items

by Ludek » Wed Aug 16, 2023 7:58 am

Thanks!

I've just corrected the documentation

Re: Submenus in Tracklist Menu Items

by DaledeSilva » Thu Jul 20, 2023 8:39 am

Oh dear.
I just figured it out by stumbling upon this other forum question and seeing the code there.

The documentation page here says that submenu should be defined here in the hierarchy:

Code: Select all

{
   action: {},
   order,
   grouporder,
   submenu,
}
But those docs are incorrect, it should be:
The documentation page here says that submenu should be defined here in the hierarchy:

Code: Select all

{
   action: {
   	   submenu
   },
   order,
   grouporder,
}

Submenus in Tracklist Menu Items

by DaledeSilva » Mon Jul 17, 2023 7:38 am

I've been trying to create a submenu in the tracklist menu, however, I can't figure out how to make it work.
I can make single items work that aren't in a submenu, but if I give it the property of submenu with an array (like specified in these docs), it's stays as a single item with no menu of children that fold out.

ie. in the code below, all I get is a single item named "Auto crossfade settings".
Please note that I've tried adding in order and grouporder values, and removing the 3rd level of submenu, but haven't seen any difference.

I'm adding this code in trackListView_add.js

Code: Select all

window.menus.tracklistMenuItems.push({
    action: {
        title: 'Auto crossfade settings',
        // icon: String,
        visible: () => uitools.getCanEdit(),
    },
    // order: Number,          // Required
    // grouporder: Number,     // Required
    submenu: [
        {
            action: {title: 'Selected tracks'},
            submenu: [
                {action: actions.autoCrossfadeTrack},
                {action: actions.alwaysCrossfadeTrack},
                {action: actions.neverCrossfadeTrack}
            ]
        },
        {
            action: {title: 'Entire <insert name> genre'},
            submenu: [
                {action: actions.autoCrossfadeTrack},
                {action: actions.alwaysCrossfadeTrack},
                {action: actions.neverCrossfadeTrack}
            ]
        },
        {
            action: {title: 'Entire <insert name> mood'},
            submenu: [
                {action: actions.autoCrossfadeTrack},
                {action: actions.alwaysCrossfadeTrack},
                {action: actions.neverCrossfadeTrack}
            ]
        },
        {
            action: {title: 'Entire <insert name> collection'},
            submenu: [
                {action: actions.autoCrossfadeTrack},
                {action: actions.alwaysCrossfadeTrack},
                {action: actions.neverCrossfadeTrack}
            ]
        },
    ]
})

Top