Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Apex 5 Dynamically remove items from a list

InoLOct 27 2015 — edited Oct 28 2015

Hi all

In Apex 5.0.2 with Universal Theme I am using a dynamic list for my drop down navigation menu. In some cases, depending on data on the page, I have to remove a specific menu item. I was hoping to use one of the extra attributes to identify the correct element, as the Apex help indicates "...optional attributes within a list template, which can be used to reference list entry user defined attributes 1 - 10".

My list query is now:

select level

  ,label

  ,decode(type,'M','#','f?p='||app||':'||page||':'||:APP\_SESSION||'::'||:DEBUG)  target

  ,null   is\_current\_list\_entry

  ,null   image

  ,null   image\_attribute

  ,null   image\_alt\_attribute

  ,**page   attribute1**

from his_apx_menu_structure

... etc ...

Attribute1 maps to data-id in the <li> element,as I verified by looking at the page source:

<li data-id**="MLFRKNR0"** data-disabled="" data-hide="" data-shortcut="" data-icon=""><a href="javascript:apex.navigation.dialog('f?p=....

However, because of some Javascript (? my guess anyway) this information is lost when the Apex Javascript adds id's and classes to the li elements. I can see with Firebug that the collapsed menu looks like:

pastedImage_0.png

So, this does not work:

$("li[data-id='MLFRKNR0']").remove();

I just get an "object not found".

This works:

$("#151_menubar_1_2").remove();

But I do not know the element id.

Any ideas on how to dynamically remove a list item from an Apex drop down menu?

Thanks for any ideas.

Ino

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2015
Added on Oct 27 2015
4 comments
1,073 views