Hi Gustavo,
You are probably using prototype right? :-)
Not sure if this will be of much help but it should give you ideas...
With ext.js I did something like this:
<script>
Ext.onReady(
function() {
Ext.select('.searchresults tr.item').on('click',
function() {
var tr = this;
...[javascript code to do something
with tr]...
}
);
}
);
</script>
Basically, there was a <table class="searchresults">...</table>. So
this code found all the <tr class="item"> inside that table and added
an anonymous function to handle click events.
Then when you click any of those rows the anonymous function would get
called and this variable would be the tr element that got clicked.
And so you then do something with it. :-)
Anyways, there's got to be something similar for prototype. For
example, prototype has a $$ function that is practically the same as
Ext.select(). You specify your DOM query and $$ returns an array of
matching elements.
And in your case I believe you have list items. Then prototype has an
Element#observe() function which seems similar to the on() function
I'm using here.
Take a look at the prototype API documentation.
On May 22, 2009, at 3:16 PM, Gustavo Pizano wrote:
Hello, I know this is out of the list topic, is more a JS-CSS
question, so if somebody can help me, I will appreciate it, or at
least some guidance to achieve what I need.
Im having some trouble with this. I have 2 selection list one next
to each other, when I select something in one list, the contents of
the other one changes. so far so good. now im in the phase to make a
better and nicer UI, so when I select something in the first list, I
need to put somehow a image above the <li> element that I selected,
so that image will be above the selected <li> element and the right
border will be touching the other list, so it will seem like the
1st list is unfolding the contents of the second list.
I was thinking using DOM to achieve that, so I can get the selected
<li> by its ID the get the position in x,y, and put the image on
that position, but here comes the questions the id are being
generated dynamically by the AjaxSelectionLsit, so I dunno which
<li> element the user has selected..
The same comes if I use the onchange binding, binded to a custom
function to position the image in the right place, I dunno where and
which exactly <li> was selected.. or do I?
sorry for the inconvenience ..I will appreciate any, any help.
Thanks
Gustavo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/rparada
%40mac.com
This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]