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!

jquery selector syntax

Earl LewisApr 1 2011 — edited Apr 3 2011
I'm working with dynamic actions (which I haven't much - done most of my javascript coding by hand so far) and trying to use the jquery selectors. In particular I'm trying to select a group of [ul] elements in a menu structure by class name. From that group I want to select only the first n items (n will be determined at runtime).

In any case, I've read lots of jquery documentation on selector syntax and trying to use the .class:gt(n) syntax, where :gt(n) is supposed to select the items greater than (thus the :gt) the indicated number. This isn't working for me. It is supposed to be hiding all elements greater than my index number, but it's actually hiding everything with that classname.

Based on this whole experiment I guess I really have two questions:
1) anyone have any idea why this might not be working?
2) what is Apex expecting when you enter a jquery selector?

Question 2 really ought to be first I suppose, because the answer to that will probably help me with question 1. But my point is this. When you use jquery outside of Apex the selector syntax is something like this:
$(".classname")
This seems to not be necessary for Apex in that if I use the following it seems to work just fine. The limited help information seems to indicate the same.
.classname
OK, great. The Apex team has "simplified" the jquery selector syntax so you don't have to do parentheses, quotes, etc... But what about jquery selectors that are more complex, e.g. my example above, or perhaps something along the lines of this:
$(".classname").filter(":eq("+ N + "), :gt(" + N + ")")
It would appear that if Apex doesn't want all the quotes and parentheses then this kind of syntax would be problematic. And, in fact, it doesn't do what I want it to do.

So I believe the answer might be that I just roll my whole selector and action code into an "Execute Javascript Code" kind of dynamic action. However, that seems to not work correctly as well.

Anyone out there familiar enough with the jquery integration with Apex dynamic actions to be able to help out here? Thanks for any pointers in the right direction.

Earl
This post has been answered by fac586 on Apr 3 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2011
Added on Apr 1 2011
4 comments
3,448 views