make menu item disabled by default?

LabKey Support Forum (Inactive)
make menu item disabled by default? Ben Bimber  2010-11-15 07:44
Status: Closed
 
in query metadata you can have something like:

                    <item text="More Actions" insertPosition="end">
                        <item text="Jump To History">
                            <onClick>
                                historyHandler(dataRegion, dataRegionName);
                            </onClick>
                        </item>
                        <item text="Jump To Other Dataset">
                            <onClick>
                                datasetHandler(dataRegion, dataRegionName);
                            </onClick>
                        </item>
                    </item>

Is there any way to make either the top level button or menu items disabled by default? This is not the same as 'requiresSelection'. The rationale for disabling by default would be for the onLoad JS code to enable the menu item as needed. The alternative would be not to have a menu item at all, and for the onLoad code to create one if appropriate.
 
 
jeckels responded:  2010-11-15 09:41
Hi Ben,

We don't have that option right now. In general, our design approach is not to add menu or other items for a particular user if they'll always be disabled. For example, we don't show a disabled Edit button if a user doesn't have permission to edit a record. Wiring up code in onLoad is what I'd recommend, at least for now.

That said, there are certainly legitimate cases for starting out with disabled menu or other UI elements, so that would be a reasonable thing to add.

Thanks,
Josh