No. My suggestion is that the ContextMenu should implement List (or subclass it
if that makes sense).
Something like this:
<j:beads>
<js:ContextMenu itemRenderer="com.foo.MyContextRenderer"
itemClick=“onItemClick(event)">
<js:dataProvider>
<fx:Array id="fooArray">
<fx:String>Check All</fx:String>
<fx:String>Uncheck All</fx:String>
</fx:Array>
</js:dataProvider>
</js:ContextMenu>
</j:beads>
> On Jan 8, 2023, at 10:39 PM, Hugo Ferreira <[email protected]> wrote:
>
> Hi Harbs,
>
> I hadn't thought about that.
> In this case is a bead to work as an extension to any component and add the
> context menu feature.
> In this case, the bead receives an array of elements.
>
> Your suggestion is to receive a List instead of an array of elements ?
>
> Harbs <[email protected]> escreveu no dia domingo, 8/01/2023 à(s) 07:14:
>
>> Yes. Thanks for working on this. :-)
>>
>> I’d suggest that a ContextMenu should be a kind of a List with a
>> dataProvider and ItemRenderers. That would fit into the common Royale
>> pattern and completely abstract the UI.
>>
>>> On Jan 8, 2023, at 9:05 AM, Yishay Weiss <[email protected]> wrote:
>>>
>>> Nice.
>>>
>>> Did you consider separating the display from the bead? For example,
>>>
>>> <js:Group id=”ctxm1”>
>>> <html:Div text="Check All“
>>>
>>> click="checkAll(true)"/>
>>>
>>> <html:Div text=“Unchek All”
>>>
>>> visible="{this.isEditable()}"
>>>
>>> click="checkAll(false)"/>
>>> </js:Group>
>>>
>>> Could go under <fx:Declarations> and then
>>>
>>> <js:ContextMenu menuObject=”{ctxm1}”/>
>>>
>>> Could go under various elements.
>>>
>>>
>>> From: Hugo Ferreira<mailto:[email protected]>
>>> Sent: Sunday, January 8, 2023 1:00 AM
>>> To: [email protected]<mailto:[email protected]>
>>> Subject: Re: Right click bead for context menu
>>>
>>> Hi,
>>>
>>> I have committed today the ContextMenu component (no Jewel dependency).
>>>
>>> Example of usage:
>>>
>>>
>>> <j:beads>
>>>
>>> <js:ContextMenu>
>>>
>>> <html:Div text="Check All“
>>>
>>> click="checkAll(true)"/>
>>>
>>> <html:Div text=“Unchek All”
>>>
>>> visible="{this.isEditable()}"
>>>
>>> click="checkAll(false)"/>
>>>
>>> </js:ContextMenu>
>>>
>>> </j:beads>
>>>
>>>
>>> The context menu can be added to any component area (inclusive and tested
>>> in itemrender DataGrid).
>>>
>>> Hugo Ferreira <[email protected]> escreveu no dia sábado, 7/01/2023
>>> à(s) 01:51:
>>>
>>>> Hi,
>>>>
>>>> Yes, it seems that this component does not exist at the moment in the
>>>> framework.
>>>> Meanwhile, I started to develop this component and it's now partial
>>>> finished and I am trying my best to make enough generic to add it to the
>>>> framework.
>>>>
>>>> Thanks.
>>>>
>>>> Maria Jose Esteve <[email protected]> escreveu no dia sexta, 6/01/2023
>>>> à(s) 12:10:
>>>>
>>>>> I couldn't find it but I have seen them do work in mx.
>>>>> I have a custom implementation that needs some work but it works for
>> me,
>>>>> if you need it, let me know and I'll share it (Jewel)
>>>>>
>>>>> Hiedra
>>>>>
>>>>> -----Mensaje original-----
>>>>> De: Hugo Ferreira <[email protected]>
>>>>> Enviado el: miércoles, 4 de enero de 2023 14:54
>>>>> Para: [email protected]
>>>>> Asunto: Right click bead for context menu
>>>>>
>>>>> Hi,
>>>>>
>>>>> There is already any bead to rigth click and context menu ?
>>>>> Like this:
>>>>>
>>>>>
>> https://itnext.io/how-to-create-a-custom-right-click-menu-with-javascript-9c368bb58724
>>>>> I didn't find and probably I will have to create it but before I start
>> I
>>>>> would like to be sure that there isn't already something similar.
>>>>>
>>>>> Thank you.
>>>>>
>>>>
>>>
>>
>>