-
1. Re: contextMenu targetSelector
jhuska Mar 4, 2013 4:46 AM (in response to srikanthreddy123)Hey Srikanth,
you need to provide JQuery selector as a value of the targetSelector attribute.
So if you have for example.
<div class="foo">Bar</div>
<div class="foo">Another content</div>
<div>Yet another content</div>
then to attach context menu to the first two divs you need to just provide 'div.foo'.
Is that what have you been asking for ? Or you are requesting more complex example, lets say the one which would work with dynamic accordion ?
-
2. Re: contextMenu targetSelector
srikanthreddy123 Mar 6, 2013 2:15 AM (in response to jhuska)Hi Juraj,
Can you please show me how can we set the JQuerySelector in this senario with this example.
I have a dynamic Accordion like this.
<rich:accordion id="accCTN" switchType="client"
activeItem="#{ctnGrpMgmtController.activeTab}">
<c:forEach id="ctnRepeatL"
items="#{ctnGrpMgmtController.ctnGroups}" var="groupName">
<rich:accordionItem switchType="client" name="#{groupName}"
headerStyle="height: 10px">
<f:facet name="header">
<h:outputText value="#{groupName}" styleClass="menuable">
</h:outputText>
</f:facet>
</rich:accordionItem>
</c:forEach>
</rich:accordion>Now I want to associate a context menu on the headers of each of the accortionItems so I used a facet with header and associated a style cla
<rich:contextMenu id="ctnGrpCtxmenu" targetSelector="menuable"
disableDefaultMenu="true">
<rich:menuItem label="Manage Permissions"
id="manPerCtxMnuItm" />
<rich:menuItem label="Add CTN"
id="addCtnCtxMnuItm" />
</rich:contextMenu>But its not working. I am not aware of how to use the targetSelector attribute to bind with JQuery selector can you please help me resolving this.
-
3. Re: contextMenu targetSelector
jhuska Mar 6, 2013 4:50 AM (in response to srikanthreddy123)I believe that you need to provide this value of targetSelector: ".menuable" as it uses JQyery selectors.
See for example this for quick overview:
http://www.w3schools.com/jquery/jquery_ref_selectors.asp
Or complete reference to JQuery selectors:
http://api.jquery.com/category/selectors/
Does it work ?