Page 1 of 1
Context Menu Selections
Posted: Tue Dec 17, 2013 12:34 pm
by DaveLClarkI
I have a grid row context menu which has options that may not all be available at a given time. What I would prefer is to not have to rebuild the content and resize the context menu each time. I would prefer to just disable (grey out) those selections that are not currently available. I can do that with native JavaScript; but, how do I accomplish that with the Profound menu widget? Thanks.
Re: Context Menu Selections
Posted: Tue Dec 17, 2013 2:05 pm
by David
You can apply any property to a widget through scripting with this:
http://www.profoundlogic.com/docs/displ ... opValue%29
Such as 'choices', etc. for a menu.
Most of the time, if you are applying a property that is not a simple CSS-type of thing, the properties are only used at the time the widget is constructed. So it's most often recommended to apply the 'field type' (see properties window for appropriate value) of the widget after you are doing making changes. This basically triggers a re-render of the component, so that it will pick up any changes to the properties.
Re: Context Menu Selections
Posted: Tue Dec 17, 2013 2:13 pm
by DaveLClarkI
Yes, that is what I was referring to by "rebuild the content" but I prefer all choices to show and just grey out (disable) the ones that don't currently apply.
An example is when you are typing in this reply box and you right-click with nothing highlighted. The resulting context menu shows the Cut, Copy, and Delete selections greyed out (not available for use). If you highlight something and right-click, then the resulting context menu shows the Cut, Copy, and Delete selections as available for use.
Re: Context Menu Selections
Posted: Tue Dec 17, 2013 2:23 pm
by David
The menu widget does not have even the concept of a 'disabled' option, so there is not a way of doing that through any built-in interfaces, sorry.
I can help with resizing (you also mentioned having to do that), though -- you can simply leave the 'height' property of the widget unset. It will expand/collapse to fit the choices that are inside.
Re: Context Menu Selections
Posted: Tue Dec 17, 2013 3:19 pm
by DaveLClarkI
Are custom widgets supported in the PUI designer that are not based on current widgets? I ask from the standpoint of whether I'm able to contemplate creating a new type of menu that supports enabled/disabled menu selections.
Re: Context Menu Selections
Posted: Tue Dec 17, 2013 4:49 pm
by David
Yes, widgets can be created 'from scratch':
http://www.profoundlogic.com/docs/displ ... om+scratch
It might be more productive to get us to do it, though. :-). We could add such a feature, if you think it would be more helpful to have it done that way? I think that this would be a good feature for the widget, in general. I couldn't guarantee a date on this, though, although I could keep you updated on progress.
This way, you could proceed with your application, just remove the unnecessary options for now, until we can update it.
Re: Context Menu Selections
Posted: Tue Dec 17, 2013 5:39 pm
by DaveLClarkI
I do think it would be a useful menu type for the designer to have. But, if it will be more than a month to actually get it, then I'm probably going to have to create it myself, anyway.